A form data structuring processing method and system based on natural language processing
Patent Information
- Application Number
- CN202611220060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies, when processing structured medical form data, fail to effectively distinguish adjacent medical transactions during the same patient's visit, leading to data mixing. Furthermore, they lack targeted corrections and source evidence for different error locations, conflicting candidate facts, and traceability, resulting in duplicate data entry and error correction.
A natural language processing-based approach is adopted to generate transaction constraint extraction tasks through event transaction envelopes and form field constraints. The medical event extraction model is used to extract specified event stages and elements, and structured form data is generated by combining closure validation and residual orientation correction.
It improves the accuracy of structured processing of form data, reduces data mixing and errors, achieves efficiency and reliability of automatic filling, and supports post-verification capabilities.
Smart Images

Figure CN123031684A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical data processing technology, and in particular to a method and system for structuring form data based on natural language processing. Background Technology
[0002] With the informatization of medical quality and safety management, hospitals typically use fixed form reporting systems to handle adverse events related to nursing care, medication, blood transfusions, surgery, and instrument use. Personnel enter event fields, and verification and archiving are completed according to a pre-set approval process. To accommodate different event types, the industry also uses a combination of dynamic form engines and workflow engines. This involves configuring field types, required attributes, option dictionaries, and approval nodes to generate reporting forms, and then retrieving patient and treatment data from HIS, EMR, and LIS systems for field filling. However, fixed forms rely on hard coding, while dynamic forms and data extraction are independent, both primarily handling existing structured fields entered manually or returned from APIs.
[0003] To reduce duplicate data entry, existing solutions utilize keyword matching, named entity recognition, or medical event extraction models to identify symptoms, times, and treatment details from medical record texts. These details are then written into structured templates based on field names, and the reliability of the results is improved through type validation, value range validation, and data traceability. However, these solutions typically fail to distinguish between adjacent medical events during the same patient's visit, and do not utilize form field hierarchy to limit event stages, event elements, and data reading scope. This easily leads to transaction mismatches and field errors. After errors are discovered, they often require full re-extraction or manual modification, and lack targeted correction for different error locations and continuous traceability between source evidence, candidate facts, validation results, and target fields.
[0004] Therefore, how to provide a method and system for structuring form data based on natural language processing is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method and system for structuring form data based on natural language processing. This invention utilizes natural language processing, transaction constraint extraction, and residual orientation verification to achieve structured form filling of multi-source adverse event data, which has the advantages of accuracy, efficiency, and traceability.
[0006] A method for structuring form data based on natural language processing according to an embodiment of the present invention includes the following steps: Acquire adverse event reporting data and hospital business data, determine the scope of the transaction, generate the event transaction envelope, and obtain the corresponding target form template; Parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task; Based on the task of extracting tasks according to transaction constraints, the medical event extraction model with transaction constraints is used to process in-hospital business data and adverse event reporting data to generate candidate facts of transactions with source evidence. Based on the event transaction envelope and form field constraints, perform closure validation on the candidate facts of the transaction, and generate closure-passed facts and closure validation residuals; Based on the closure check residual, the candidate facts of the transaction are corrected and the closure check is performed again to generate the updated closure pass facts and matters to be confirmed. The updated closure is written into the target form template with facts, linked to source evidence to form a field evidence chain, and combined with the matters to be confirmed to generate structured form data.
[0007] Optionally, the generation of the event transaction envelope and the target form template specifically includes: Unify the patient identification, visit identification, and time format in adverse event reporting data and hospital business data; extract the reporting event type and reporting event time; and generate source data alignment results. Based on the reporting event type and reporting event time in the source data alignment results, filter the in-hospital business data of the same patient and the treatment process, and determine the business data identifier carried by the matched in-hospital business data as the transaction anchor point; Read the in-hospital business data identified by the transaction anchor point, extract the patient identifier, visit identifier, and event carrier object identifier, and combine them to generate a transaction object; By tracing the preceding and following internal business data according to the transaction anchor point and transaction object, the start time and end time of the transaction are determined, and the transaction time boundary is generated. The transaction scope is defined by the transaction object and the transaction time boundary. The event type, transaction anchor point, transaction object and transaction time boundary are written into the event transaction envelope. Dynamic form configuration is selected from the form configuration library and the target form template is generated.
[0008] Optionally, the generation of the transaction constraint extraction task specifically includes: Traverse the ordered fields of the target form template and identify the fields with the input method of automatic writing or automatic suggestion and with fact role identifiers as the target fields for extraction. Traverse back level by level along the parent field identifier of the target field, and connect the fact role identifiers at each level according to the arrangement order in the target form template to generate the fact role path; The form field constraints for the target field to be extracted are composed of the factual role path, data type, option code, allowed source type, and evidence type. The allowed source types in the form field constraints are mapped to the event transaction envelope, and the field reading range of each extraction target field is determined according to the transaction object and transaction time boundary; Generate field extraction instructions according to the target fields, and combine the field extraction instructions into transaction constraint extraction tasks according to the order in the target form template.
[0009] Optionally, the generation of the transaction candidate facts specifically includes: Based on the field reading range, the hospital's business data is transcribed into text with source location, and the adverse event reporting data is segmented by sentence and the character position is retained to generate extracted text; The field extraction instructions and the extracted text are used as the model input. The model is input into the transaction constraint medical event extraction model and then contextually encoded using a Chinese MacBERT-base encoder to generate transaction semantic encoding. Input the transaction semantic encoding into the 7-head GlobalPointer layer, and activate the corresponding event element extraction head according to the fact role path to generate event element fragments; Extract the transaction semantic code corresponding to the event element fragments, and generate the preceding and following association categories, extraction results and the time of occurrence of the facts through a 256-dimensional fragment projection layer and a double affine classification layer; Based on the source locations preserved in the extracted text, the target event element fragments are mapped to source evidence, and candidate facts for the transaction are generated.
[0010] Optionally, the generation of the closure through facts and closure verification residuals specifically includes: Based on the source evidence, locate the source data, and verify the transaction attribution and the time of occurrence of the facts in the source data according to the event transaction envelope to generate transaction attribution residuals; Read the form field constraints according to the field identifier, verify the fact role path, event stage, extraction result and source type of the candidate facts of the transaction, and generate fields to carry residuals; According to the reported event type, verify the candidate facts of the transaction at different event stages and their related categories, and generate related residuals; Verify the completeness and locatability of the source evidence according to the evidence type in the form field constraints, and generate source evidence residuals; Summarize transaction attribution residuals, field-carrying residuals, contextual residuals, and source evidence residuals, and generate a closure to verify the residuals using facts and the closure.
[0011] Optionally, the updated closure, through the generation of facts and matters to be confirmed, specifically includes: Based on the transaction attribution residuals, perform transaction reselection on the corresponding transaction candidate facts to generate revised transaction candidate facts; Based on the residual carried by the field, the target field is redirected for the corresponding transaction candidate fact to generate the corrected transaction candidate fact; Based on the residuals of the preceding and following events, the missing or unconnected event phases are re-extracted to generate corrected transaction candidate facts; Based on the source evidence residuals, source data corresponding to the evidence type is extracted to generate corrected source evidence; Based on the fact conflict residuals, the conflict sources are reread and the extraction results are verified to generate corrected candidate facts for transactions or matters to be confirmed. Only the revised transaction candidate facts are re-validated to generate updated closure-passed facts and pending confirmation items.
[0012] Optionally, the generation of the structured form data specifically includes: The updated closure is written into the corresponding field of the target form template according to the field identifier, generating a definite field value; By concatenating the values of each determined field in the order of source evidence, candidate facts of the transaction, closure verification results, and target field, a field evidence chain is generated. Write the items to be confirmed into the confirmation area, which is isolated from the field values to generate the field confirmation content; The template identifier, version number, determined field values, field evidence chain, and field confirmation content of the target form template are combined to generate structured form data.
[0013] A form data structuring system based on natural language processing according to an embodiment of the present invention includes: The transaction configuration module is used to obtain adverse event reporting data and hospital business data, determine the transaction scope, generate event transaction envelopes, and obtain the corresponding target form templates. The task generation module is used to parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task. The transaction fact extraction module is used to process in-hospital business data and adverse event reporting data according to the transaction constraint extraction task and the transaction constraint medical event extraction model to generate transaction candidate facts with source evidence. The closure validation module is used to perform closure validation on candidate facts of transactions based on the event transaction envelope and form field constraints, and generate closure-passing facts and closure validation residuals. The residual correction module is used to correct the candidate facts of the residual verification transaction based on the closure verification and to perform closure verification again, generating updated closure pass facts and matters to be confirmed. The structured form generation module is used to write the updated closure into the target form template with facts, associate source evidence to form a field evidence chain, and generate structured form data by combining the matters to be confirmed.
[0014] The beneficial effects of this invention are: This invention limits the processing scope of adverse event reporting data and hospital business data by using event transaction envelopes. It distinguishes between adjacent medical execution events and abnormal observation events within the same patient and the same medical process using transaction anchors, transaction objects, and transaction time boundaries, reducing data mixing between different drugs, devices, surgeries, or abnormal procedures. Furthermore, it converts the field hierarchy, fact role paths, data types, option codes, and allowed source types in the target form template into transaction constraint extraction tasks. This allows the transaction-constrained medical event extraction model to extract only the specified event stage and event elements from the corresponding field reading range, reducing irrelevant text interference and semantic mismatches between the extraction results and the target fields, thus improving the accuracy of structured processing of adverse event form data.
[0015] This invention associates extracted transaction candidate facts with source systems, business data identifiers, source fields, or original text character positions, and performs closure validation based on event transaction envelopes and form field constraints. This enables the identification of incorrect transaction attribution, incorrect field carrying, missing event stage associations, missing source evidence, and conflicts between multiple sources. Different closure validation residuals are respectively fed back to the transaction reselection, target field redirection, specified event stage re-extraction, source evidence replenishment, and conflict source rereading stages. Only transaction candidate facts that generate residuals are reprocessed, thus avoiding repeated execution of all transaction constraint extraction tasks, reducing invalid data reading and model inference, and minimizing the impact of the correction process on facts that have already passed validation.
[0016] This invention only writes the updated closure into the target form template as facts, while writing any remaining residuals or conflicting information into a separate verification area. This prevents unverified extraction results from directly becoming definitive field values. By forming a field evidence chain in the order of source evidence, candidate facts of the transaction, closure verification results, and target fields, each automatically written field can be traced back to an internal business field or adverse event reporting text, and the corresponding transaction and verification process are preserved. The generated structured form data can also be applied to the original approval workflow, event archiving, and quality control statistics, thus balancing automatic reporting efficiency, data reliability, and post-verification capabilities. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a form data structuring method based on natural language processing proposed in this invention; Figure 2 This is a flowchart of residual-oriented correction for a form data structuring method based on natural language processing proposed in this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0019] refer to Figures 1-2 A method for structuring form data based on natural language processing includes the following steps: Acquire adverse event reporting data and hospital business data, determine the scope of the transaction, generate the event transaction envelope, and obtain the corresponding target form template; Parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task; Based on the task of extracting tasks according to transaction constraints, the medical event extraction model with transaction constraints is used to process in-hospital business data and adverse event reporting data to generate candidate facts of transactions with source evidence. Based on the event transaction envelope and form field constraints, perform closure validation on the candidate facts of the transaction, and generate closure-passed facts and closure validation residuals; Based on the closure check residual, correct the candidate facts of the transactions and perform closure check again to generate updated closure pass facts and matters to be confirmed; The updated closure is written into the target form template with facts, linked to source evidence to form a field evidence chain, and combined with the matters to be confirmed to generate structured form data.
[0020] In this embodiment, the generation of the event transaction envelope and the target form template specifically includes: Unify the patient identification, visit identification, and time format in adverse event reporting data and hospital business data; extract the reporting event type and reporting event time; and generate source data alignment results. Based on the reporting event type and reporting event time in the source data alignment results, filter the in-hospital business data of the same patient and the treatment process, and determine the business data identifier carried by the matched in-hospital business data as the transaction anchor point; The reported events are categorized into medical execution events and abnormal observation events. Medical execution events correspond to business data related to medical order execution, blood transfusion, surgery, or device use, while abnormal observation events correspond to business data related to nursing abnormalities, equipment alarms, or adverse event reports. During the screening process, the business identifier carried by the reported data, the name of the event carrier, the business execution period, and the reported event time are matched sequentially. If the business identifier matches directly, the corresponding business data is selected. If there is no direct match, the business data with the same event carrier name and whose business execution period includes the reported event time is selected. If multiple matches still exist, the business data with the smallest distance from the reported event time is selected. Read the in-hospital business data identified by the transaction anchor point, extract the patient identifier, visit identifier, and event carrier object identifier, and combine them to generate a transaction object; The transaction objects include patient identifiers, visit identifiers, and event carrier object identifiers. The event carrier object identifiers for medical execution events are taken from the hospital's internal codes for drugs, blood products, surgeries, or instruments. The event carrier object identifiers for abnormal observation events are taken from the hospital's internal codes for abnormal sites, abnormal items, or alarm devices. When the same transaction anchor point corresponds to multiple event carrier objects, transaction objects are generated separately. By tracing the preceding and following internal business data according to the transaction anchor point and transaction object, the start time and end time of the transaction are determined, and the transaction time boundary is generated. The start time of the transaction is the time when the medical execution status first changes to executed, or the time of the first business data of the same abnormal project with consecutive abnormal statuses; the end time of the transaction is the time when the medical execution status changes to completed or terminated, or the time when the abnormal status first returns to normal or is handled completely; when there is no normal status or handling completed status between adjacent business data of the same abnormal project, they are classified into the same abnormal process. If the end time of the transaction is not obtained, the data processing time of this transaction is used as the upper bound and marked as an open transaction. The scope of a transaction is defined by the transaction object and the transaction time boundary. The event type, transaction anchor point, transaction object and transaction time boundary are written into the event transaction envelope. Dynamic form configuration is selected from the form configuration library and the target form template is generated. The dynamic form configuration is generated and written to the form configuration library by the form design end when publishing the adverse event form. It includes template identifier, applicable event type, version number, effective start and end time, and publication status. It also includes field identifier, field semantic name, data type, input method, option code, required field mark, parent field identifier, sorting number, fact role identifier, allowed source type, and evidence type for each field. Dynamic form configurations with the same applicable event type as the reported event type, published status, and effective start and end time covering the reported event time are selected from the form configuration library. If there are multiple selection results, the dynamic form configuration with the largest version number is selected. The fields are organized according to the parent field identifier and sorting number to generate a target form template composed of template identifier, version number, applicable event type, and ordered fields.
[0021] In this embodiment, the generation of the transaction constraint extraction task specifically includes: Traverse the ordered fields of the target form template and identify the fields with the input method of automatic writing or automatic suggestion and with fact role identifiers as the target fields for extraction. Traverse back level by level along the parent field identifier of the target field, and connect the fact role identifiers at each level according to the arrangement order in the target form template to generate the fact role path; The fact role path sequentially expresses the event type, event stage, and event elements. The event stage uses six categories of identifiers: basic object, medical execution, abnormal manifestation, injury result, treatment action, and recovery result. The event elements use object, status, time, location, degree, negative status, and contextual association identifiers. The process terminates when the parent field identifier is empty. Layout fields without fact role identifiers are deleted from the backtracking results, and fact role identifiers are retained in the order from parent field to target field. The form field constraints for the target field to be extracted are composed of the factual role path, data type, option code, allowed source type, and evidence type. The data types specified in the data type definition limit the extraction results to text values, numerical values and units, date and time values, single-item codes, or multiple-item codes; the option codes limit the writable values for single-item codes and multiple-item codes; the source type allows specifying the adverse event reporting data or internal business data category from which the corresponding facts can be obtained; the evidence type can be business field evidence, text fragment evidence, or composite evidence. Business field evidence consists of a source system identifier, a business data identifier, and a source field identifier; text fragment evidence consists of a source text identifier and the start and end character positions of the extracted content; and composite evidence includes both business field evidence and text fragment evidence. The allowed source types in the form field constraints are mapped to the event transaction envelope, and the field reading range of each extraction target field is determined according to the transaction object and transaction time boundary; The categories of in-hospital business data are determined by the source system interface identifier and the business category identifier. Adverse event reporting data is marked as the reporting text category. For each extracted target field, data that is allowed to have the same source type, patient identifier and visit identifier that are consistent with the transaction object, and whose data time is within the transaction time boundary are retained. When in-hospital business data has an event carrier object identifier, it is also made consistent with the event carrier object identifier in the transaction object. When it does not carry an event carrier object identifier, the associated in-hospital business data is tracked through the transaction anchor point. For open transactions, the data processing time of this transaction is used as the end time of the field reading range. Generate field extraction instructions according to the target fields, and combine the field extraction instructions into transaction constraint extraction tasks according to the order in the target form template. The field extraction instructions are written sequentially to the event type, transaction anchor point, transaction object, transaction time boundary, field identifier, fact role path, data type, option code, field reading range, and evidence type, so that the natural language processing process extracts only the event elements specified by the fact role path from the field reading range; the transaction constraint extraction task is executed according to the parent field precedes the child field, and the sibling fields are executed according to the sort order, and the field identifier, fact role path, event stage, extraction result, and source evidence are determined as the output content of the transaction candidate facts.
[0022] In this embodiment, the generation of the transaction candidate facts specifically includes: Based on the field reading range, the hospital's business data is transcribed into text with source location, and the adverse event reporting data is segmented by sentence and the character position is retained to generate extracted text; The field extraction instructions and the extracted text are used as the model input. The model is input into the transaction constraint medical event extraction model and then contextually encoded using a Chinese MacBERT-base encoder to generate transaction semantic encoding. The transaction-constrained medical event extraction model consists of a Chinese MacBERT-base encoder, a 7-head GlobalPointer layer, a 256-dimensional fragment projection layer, and a dual affine classification layer. The model initializes the Chinese MacBERT-base encoder with Chinese MacBERT-base parameters and initializes the 7-head GlobalPointer layer, 256-dimensional fragment projection layer, and dual affine classification layer using Xavier uniform distribution. The model uses anonymized in-hospital text labeled with event stages, event elements, and related categories for concatenation. For combined training, the 7-head GlobalPointer layer uses multi-label classification cross-entropy, and the dual affine classification layer uses multi-classification cross-entropy. The two cross-entropies are added together and then the model parameters are updated in reverse. The AdamW optimizer is used for training, with an initial learning rate of 0.00002 and a weight decay rate of 0.01. Each training batch contains 16 samples, and the maximum number of training epochs is 20. Training is terminated when the overall F1 score on the validation set is not improved after 3 consecutive training epochs. The overall F1 score is the arithmetic mean of the F1 score for event element fragment recognition and the F1 score for the preceding and following association classification. The F1 score is the harmonic mean of precision and recall. The model input is concatenated in the order of classification identifier, field extraction instruction, separator identifier, extracted text, and end identifier. The field extraction instruction sequentially includes the event type, transaction object, factual role path, data type, and option code. The Chinese MacBERT-base encoder comprises a 12-layer Transformer encoder, each layer with 12 attention heads, a hidden dimension of 768, a feedforward network dimension of 3072, and a dropout rate of 0.1. The Chinese MacBERT-base encoder uses self-attention to calculate the semantic association between the factual role path and each word in the extracted text, outputting a 768-dimensional context vector corresponding to each input word. The context vectors corresponding to the classification identifier, field extraction instruction, separator identifier, and end identifier are deleted, while the context vectors corresponding one-to-one with each word in the extracted text and their original character positions are retained to generate transaction semantic codes. Each model input segment contains no more than 512 words. If the number of words exceeds 512, the complete field extraction instruction is retained, and only sliding segmentation is performed on the extracted text, with adjacent extracted text segments overlapping by 64 words. Input the transaction semantic encoding into the 7-head GlobalPointer layer, and activate the corresponding event element extraction head according to the fact role path to generate event element fragments; The seven-head GlobalPointer layer is configured with an object extraction head, a state extraction head, a time extraction head, a location extraction head, a degree extraction head, a negation state extraction head, and a preceding and following association identifier extraction head. The event element extraction head corresponding to the last-level fact role identifier in the fact role path is determined as the target extraction head, and the object extraction head, time extraction head, negation state extraction head, and preceding and following association identifier extraction head are enabled simultaneously. Each event element extraction head converts each 768-dimensional context vector in the transaction semantic encoding into a 64-dimensional start position vector and a 64-dimensional end position vector through two linear mappings. After applying rotational position encoding to the start position vector and the end position vector, the inner product of any start word and end word in the extracted text is calculated, and the resulting inner product is determined as the span score of the corresponding event element category. Event element fragments with a span score greater than 0 and a start position no later than an end position are retained. When event element fragments generated by different sliding windows have the same event element category and the same original character start and end positions, only the event element fragment with the largest span score is retained, and nested fragments corresponding to different event element categories are retained separately. Extract the transaction semantic code corresponding to the event element fragments, and generate the preceding and following association categories, extraction results and the time of occurrence of the facts through a 256-dimensional fragment projection layer and a double affine classification layer; The 256-dimensional fragment projection layer reads the 768-dimensional context vector corresponding to the starting word of each event element fragment, the 768-dimensional context vector corresponding to the ending word, and the average value of the 768-dimensional context vectors corresponding to each word in the fragment. These three are concatenated into a 2304-dimensional fragment code, which is then converted into a 256-dimensional fragment code through a fully connected mapping and the ReLU activation function. Event element fragments generated by the target extraction head are identified as target event element fragments. Target event element fragments with the same business data identifier and the same transaction object are directly grouped into the same event with other event element fragments. For target event element fragments from adverse event reporting data, they are paired with other event element fragments in the same sentence to form fragment pairs to be judged. When the preceding and following association identifiers are located in adjacent sentences, the target event element fragment is paired with the event element fragments in the corresponding adjacent sentence to form fragment pairs to be judged. The dual affine classification layer receives two 256-dimensional segment codes from the segment pair to be judged. It generates scores for five categories—same event, causality, sequence, response, and no association—through bilinear and linear computation terms. The category with the highest score is determined as the sequence-related category, and segment pairs to be judged that are unrelated are deleted. Event element segments with the same event, causality, sequence, or response category as the target event element segment are combined according to factual role paths. The corresponding content is converted based on data type and option encoding to generate extraction results. Text values retain the corresponding source content, while numerical values and units are extracted separately. Chinese numerals are converted to Arabic numerals. Date and time values are parsed based on the relative time expression of the corresponding data time. For single-item and multi-item codes, the source content is matched with the option name corresponding to the option code. If a unique match is found, the corresponding option code is written. If no unique match is found, the source content is retained and no option code is written. Time-type event element fragments associated with target event element fragments are converted to the actual occurrence time. If no time-type event element fragment is obtained, the data time of the corresponding hospital business data is used. Adverse event reporting data uses the reporting event time. If the time is still not obtained, the actual occurrence time is left blank. Based on the source locations preserved in the extracted text, the target event element fragments are mapped to source evidence, and candidate facts for the transaction are generated; When the target event element fragment originates from internal business data, the source system identifier, business data identifier, and source field identifier are read based on the source position corresponding to its lexical units. When the target event element fragment originates from adverse event reporting data, the source text identifier and the start and end positions of the original characters are read based on the source position corresponding to its lexical units. When the evidence type in the field extraction instruction is business field evidence, the source system identifier, business data identifier, and source field identifier are written into the source evidence. When the evidence type is text fragment evidence, the source text identifier and the start and end positions of the original characters are written into the source evidence. When the evidence type is composite evidence, the business field identifier, the event stage, and the extraction result are consistent. Business field evidence and text fragment evidence are merged and written into the source evidence. When business field evidence is missing, a business field evidence missing identifier is written; when text fragment evidence is missing, a text fragment evidence missing identifier is written. The field identifier and fact role path are read from the field extraction instruction. The event stage is read from the fact role path. The transaction anchor and transaction object are read from the event transaction envelope. The field identifier, fact role path, event stage, transaction anchor, transaction object, extraction result, fact occurrence time and related categories, and source evidence are combined into transaction candidate facts. When different sources corresponding to the same transaction object and event stage produce different extraction results, transaction candidate facts are generated respectively.
[0023] In this embodiment, the generation of the closure through facts and closure verification residuals specifically includes: Based on the source evidence, locate the source data, and verify the transaction attribution and the time of occurrence of the facts in the source data according to the event transaction envelope to generate transaction attribution residuals; The patient identifier and visit identifier of the source data should be consistent with the transaction object; the business data identifier of the in-hospital business data should be equal to the transaction anchor point or be traceable to the transaction anchor point; the event carrier object identifier should be consistent with the transaction object; and the fact occurrence time should be within the transaction time boundary. If the source data does not meet any of these conditions, the corresponding transaction candidate facts, failed items, and actual content will be written into the transaction attribution residual. Read the form field constraints according to the field identifier, verify the fact role path, event stage, extraction result and source type of the candidate facts of the transaction, and generate fields to carry residuals; The fact role path and event stage should be consistent with the form field constraints, the extraction result should conform to the corresponding data type and fall into the writable value limited by the option code, and the data category corresponding to the source evidence should be included in the allowed source type; if any one of them is inconsistent, the corresponding transaction candidate fact, failed item and target field identifier will be written into the field carrying residual; According to the reported event type, verify the candidate facts of the transaction at different event stages and their related categories, and generate related residuals; Abnormal behavior in the medical execution event should be associated with medical execution, injury result should be associated with abnormal behavior, treatment action should be associated with abnormal behavior or injury result, and recovery result should be associated with treatment action; abnormal behavior in the abnormal observation event can be directly associated with the transaction anchor point; when the same event, causality, sequence or treatment response category fails to form a corresponding stage connection, a sequential correlation residual is generated; when there is only the sequence of the factual occurrence, it is not considered to form a corresponding stage connection. Verify the completeness and locatability of the source evidence according to the evidence type in the form field constraints, and generate source evidence residuals; The business field evidence should be able to be located to the corresponding internal business data and source field, the text fragment evidence should be able to be located to the corresponding adverse event reporting data and the original character position, and the composite evidence should contain both business field evidence and text fragment evidence; the source content obtained by locating should be consistent with the extraction result after being converted according to the data type and option encoding; if the locating is not completed, the specified evidence is missing, or the conversion result is inconsistent, a source evidence residual will be generated. Summarize transaction attribution residuals, field-carrying residuals, contextual correlation residuals, and source evidence residuals, and generate a closure to verify the residuals using facts and the closure. The closure verification residual is written to the corresponding transaction candidate fact, residual type, and failed item; transaction candidate facts that do not generate closure verification residuals generate closure passed facts; when the same field identifier corresponds to multiple transaction candidate facts that do not generate closure verification residuals, if the extraction results are consistent, the source evidence is merged and one closure passed fact is generated; if the extraction results are inconsistent, a fact conflict residual is generated and included in the closure verification residual.
[0024] In this embodiment, the updated closure, through the generation of facts and matters to be confirmed, specifically includes: Based on the transaction attribution residuals, perform transaction reselection on the corresponding transaction candidate facts to generate revised transaction candidate facts; The transaction reselection excludes the original transaction anchor point based on the failed items in the transaction attribution residual, and redetermines the transaction anchor point, transaction object, and transaction time boundary in the in-hospital business data corresponding to the same patient identifier and visit identifier, and updates the event transaction envelope; only the field identifier corresponding to the transaction attribution residual is used to read the form field constraints, redetermine the field reading range and field extraction instructions, and process the data within the field reading range to generate the corrected transaction candidate facts; Based on the residual carried by the field, the target field is redirected for the corresponding transaction candidate fact to generate the corrected transaction candidate fact; The target field redirection is based on the event stage, event element, data type, and source type recorded in the field-carrying residual. It filters target fields in the target form template where the final-level fact role identifier of the fact role path matches the event element, the data type can carry the extraction result, and the source type is allowed to contain the corresponding source type. If the filtering result is unique, the target field is determined as the redirected target field, the field identifier and fact role path are updated, and the field extraction instruction is regenerated according to the form field constraints of the target field. If the filtering result is empty or multiple results exist, the field-carrying residual is retained. Based on the residuals of the preceding and following events, the missing or unconnected event phases are re-extracted to generate corrected transaction candidate facts; The re-extraction process reads the two event stages that need to be connected from the preceding and following correlation residuals, writes the event stages that have already passed closure and their extraction results into the corresponding field extraction instructions, and determines the event stages that have not formed a connection and the preceding and following correlation categories that need to be formed as the extraction targets for this time; only the field reading range corresponding to the event stage is processed, and event elements that have the same event, cause and effect, sequence or disposal response category as the event stages that have already passed closure are extracted to generate the corrected transaction candidate facts; Based on the source evidence residuals, source data corresponding to the evidence type is extracted to generate corrected source evidence; When the source evidence residual lacks business field evidence, the hospital's business data within the transaction time boundary is read according to the transaction anchor point, transaction object, and allowed source type, and the source field corresponding to the extraction result is located; when the source evidence residual lacks text fragment evidence, the original character position corresponding to the extraction result is located in the corresponding adverse event reporting data; when the source content recorded in the source evidence residual is inconsistent, only the inconsistent source data is reread and the source content is converted according to the data type and option encoding; the supplemented evidence is written into the source evidence of the corresponding transaction candidate fact. Based on the fact conflict residuals, the conflict sources are reread and the extraction results are verified to generate corrected candidate facts for transactions or matters to be confirmed. The data from each source corresponding to the fact conflict residual are reread according to their source evidence and the extraction results are regenerated using the same data type and option encoding. When the regenerated extraction results are consistent, the evidence from each source is merged and a corrected transaction candidate fact is generated. When the regenerated extraction results are still inconsistent, the field identifier, each extraction result, each source evidence and the fact conflict residual are written into the pending confirmation items. Only perform closure validation again on the revised transaction candidate facts to generate updated closure-passed facts and pending confirmation items; The re-performation of closure verification only processes the transaction candidate facts corresponding to the closure verification residuals, and does not reprocess the transaction candidate facts that have not generated closure verification residuals; the original closure-passed facts and the transaction candidate facts that have passed after the re-performation of closure verification are merged into the updated closure-passed facts; if closure verification residuals are still generated after the re-performation of closure verification, or if no new transaction anchor, target field, event phase or source evidence is obtained, the correction of the corresponding transaction candidate facts is stopped, and the field identifier, extraction result, source evidence, residual type and failed items are written into the pending confirmation items.
[0025] In this embodiment, the generation of the structured form data specifically includes: The updated closure is written into the corresponding field of the target form template according to the field identifier, generating a definite field value; The determined field values are taken only from the updated closure pass facts; the transaction candidate facts with closure verification residuals and the extraction results in the pending confirmation items shall not be written into the corresponding fields of the target form template, and fields that have not obtained the updated closure pass facts shall remain unfilled. By concatenating the values of each determined field in the order of source evidence, candidate facts of the transaction, closure verification results, and target field, a field evidence chain is generated. The field evidence chain starts with the source system identifier, business data identifier, source field identifier, source text identifier, or the start and end positions of the original characters recorded in the source evidence. It connects the transaction anchor point, transaction object, fact role path, event stage, extraction result, fact occurrence time, and related categories in the corresponding transaction candidate fact. The closure is verified by using the identifier as the closure verification result. Then, it connects the template identifier, version number, field identifier, and determined field value in the target form template. When the same determined field value has multiple source evidences, each source evidence is connected to the same transaction candidate fact. Write the items to be confirmed into the confirmation area, which is isolated from the field values to generate the field confirmation content; The confirmation area is located outside the defined field values of the target form template. The field confirmation content includes the field identifier, the extraction result to be confirmed, the source evidence, the residual type, the failed item, and the confirmation status. The field confirmation content is not used as the defined field value of the corresponding field before the confirmation result is obtained, and it does not participate in the closure connection in the field evidence chain. The template identifier, version number, determined field values, field evidence chain, and field confirmation content of the target form template are combined to generate structured form data.
[0026] A form data structuring system based on natural language processing includes: The transaction configuration module is used to obtain adverse event reporting data and hospital business data, determine the transaction scope, generate event transaction envelopes, and obtain the corresponding target form templates. The task generation module is used to parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task. The transaction fact extraction module is used to process in-hospital business data and adverse event reporting data according to the transaction constraint extraction task and the transaction constraint medical event extraction model to generate transaction candidate facts with source evidence. The closure validation module is used to perform closure validation on candidate facts of transactions based on the event transaction envelope and form field constraints, and generate closure-passing facts and closure validation residuals. The residual correction module is used to correct the candidate facts of the residual verification transaction based on the closure verification and to perform closure verification again, generating updated closure pass facts and matters to be confirmed. The structured form generation module is used to write the updated closure into the target form template with facts, associate source evidence to form a field evidence chain, and generate structured form data by combining the matters to be confirmed.
[0027] Example 1: To verify the feasibility of this invention in practice, it was applied to the adverse event reporting scenario of a tertiary-level general hospital in a certain city. The hospital's original system mainly relied on medical staff manually filling in structured fields and backfilling patient basic information from the HIS and electronic medical record systems. When the same patient received multiple medications, blood transfusions, or instrument operations within a short period of time, directly retrieving business data based on patient identification and reporting time easily mixed adjacent medical processes; there were also discrepancies in time expressions, inconsistent drug abbreviations, and scattered treatment results among nursing records, adverse event descriptions, and medical order execution data. The original natural language extraction program identified entities based on field names, but could not determine which medical execution the abnormal behavior belonged to, nor could it determine whether the extracted content could be directly written into the form. During the implementation period of one year, 6,420 adverse event reporting data and 412,700 related in-hospital business data were generated. The in-hospital business data came from the HIS, electronic medical record system, nursing record system, infusion execution system, surgical anesthesia system, and equipment alarm system.
[0028] The transaction-constrained medical event extraction model was trained using 8640 anonymized in-hospital text segments, with 6912 segments used as training data, 864 segments as validation data, and 864 segments as test data. The training data consisted of adverse event descriptions, nursing records, doctor's order execution instructions, and treatment records. Two medical quality management personnel labeled the basic object, medical execution, abnormal manifestation, injury result, treatment action, and recovery result, respectively, and annotated the corresponding text with the object, status, time, location, severity, negative status, and correlation markers. Discrepancies in labeling were reviewed by a physician with clinical quality management experience. The model was formed by connecting a Chinese MacBERT-based encoder, a 7-head GlobalPointer layer, a 256-dimensional segment projection layer, and a dual affine classification layer. The 7-head GlobalPointer layer identified 7 types of event element segments, and the dual affine classification layer determined whether the event was the same, causally, sequentially, in response to treatment, or unrelated. During training, the cross-entropy of multi-label classification used for event element fragment recognition and the cross-entropy of multi-class classification used for context association classification were added together. The AdamW optimizer was used to update the model parameters in reverse. The initial learning rate was 0.00002, the weight decay rate was 0.01, and 16 samples were input per batch. When the model reached the 14th epoch, the overall F1 score on the validation set had not improved for three consecutive epochs. Training was then terminated, and the model parameters with the highest overall F1 score were retained.
[0029] In an actual data entry process, a patient began intravenous ceftriaxone infusion at 14:02 on a certain day. At 14:20, the patient developed a rash on the forearm and chest tightness. The infusion was stopped at 14:23, and the patient received anti-allergy treatment at 14:31. At 16:08, the nursing record showed that the chest tightness had disappeared and the rash had shrunk. During the same visit, there was also a levofloxacin order registered at 14:35. The original system had mistakenly identified this order as a medical execution corresponding to the abnormal symptoms. This invention first standardizes the patient identifier, visit identifier, and time format. Based on the business data identifier carried by the ceftriaxone execution data, the transaction anchor point is determined. The transaction object is formed using the patient identifier, visit identifier, and ceftriaxone hospital code. The period from 14:02 to 16:08 is defined as the transaction time boundary, thereby generating an event transaction envelope. The system then selects the target form template with the highest version number that is in effect from the form configuration library based on the type of event and the time of submission. It then parses the fact role path, data type, option code, allowed source type and evidence type corresponding to the drug name, medical execution time, abnormal manifestation, abnormal location, treatment action and recovery result to form a transaction constraint extraction task.
[0030] The transaction-constrained medical event extraction model only processes adverse event reporting data and in-hospital business data within the field reading range. It extracts event elements such as ceftriaxone, intravenous infusion, forearm rash, chest tightness, infusion cessation, anti-allergy treatment, and symptom relief, and forms candidate facts for transactions based on the same event, causality, sequence, and treatment response. Each candidate fact retains the source system identifier, business data identifier, source field identifier, or the start and end positions of the original characters. Closure verification generates a transaction attribution residual when the event carrier object identifier of the levofloxacin candidate fact is inconsistent with the transaction object, excludes the original matching result, and reselects ceftriaxone execution data. When the recovery result does not form a treatment response with the treatment action, a before-and-after correlation residual is generated, and only the field reading range corresponding to the recovery result is re-extracted. If the adverse event description records an abnormal time of 14:18, while the nursing record records 14:20, and the two contents are still inconsistent after rereading, the system writes it as a pending confirmation item and does not automatically write it as a confirmed field value. The remaining transaction candidate facts that pass the closure verification again are merged with the original closure verification facts and form a field evidence chain in the order of source evidence, transaction candidate facts, closure verification results and target fields.
[0031] The implementer randomly selected 1200 adverse event data points from the aforementioned period for manual review and compared them with a control scheme that directly extracted data from the Chinese MacBERT-base, wrote it according to field names, and re-extracted all data when errors occurred. The transaction attribution accuracy of this invention was 96.58%, compared to 88.75% for the control scheme; the field value determination accuracy was 93.42%, compared to 84.17% for the control scheme; the event stage association completeness rate was 91.83%, compared to 79.58% for the control scheme; and the source evidence locatability rate was 98.08%, compared to 86.92% for the control scheme. The 1200 data points generated 17836 candidate facts for transactions, of which 1472 produced closure verification residuals. This invention only reprocessed the 1472 corresponding facts, while the control scheme required reprocessing all 17836 candidate facts, reducing the secondary processing workload by 91.75%. The average time to generate a single structured form data using this invention is 2.46 seconds, compared to 3.71 seconds for the control scheme. Each form requires an average of 2.31 fields to be manually verified, compared to 5.74 fields for the control scheme. The results indicate that this invention can reduce the mixing of adjacent medical transactions and the miswriting of unverified content, improving the accuracy of form fields and the traceability of evidence while reducing the workload of repetitive model reasoning and manual verification.
[0032] Table 1. Comparison of the overall performance of structured processing of multi-source adverse event forms.
[0033] Comparative experiments were conducted under the same data partitioning, training samples, computing equipment, and manual review standards. Experimental data was drawn from adverse event reporting data and related internal business data generated by the hospital over a year. The test set contained 1200 adverse event forms, resulting in 17836 candidate facts. Each deep learning method used the same training, validation, and test sets, and each method was trained independently three times. The data in the table is the arithmetic mean of the three experimental results. The secondary processing experiment uniformly corrected forms that exhibited transaction mismatches, field mismatches, missing event stage associations, missing evidence, or factual conflicts after the initial processing. Methods lacking residual-oriented correction capabilities reprocessed all candidate facts.
[0034] Based on the event element recognition results, the BiLSTM-CRF medical entity extraction and dictionary field mapping method achieved an F1 score of 84.62% for event element fragments, while the Chinese MacBERT-base-CRF sequence labeling and field name mapping method improved this to 88.97%, indicating that context encoding can improve the recognition performance of drug abbreviations, relative time expressions, and cross-word entities. After adding GlobalPointer and double affine relation classification, the F1 score for event element fragments reached 91.76%, and the F1 score for context association classification reached 88.41%, demonstrating that span recognition and fragment relationship classification have a significant effect on nested event elements and cross-sentence associations. The event element fragment F1 score of the method of this invention is 92.48%, which is 0.72 percentage points higher than the closest Chinese MacBERT-base, GlobalPointer and double affine relation classification direct writing method, and the improvement is within a reasonable range. The F1 score of the context association classification is improved by 2.51 percentage points. The main reason is that the field extraction instruction inputs the event type, transaction object, fact role path, data type and option encoding into the Chinese MacBERT-base encoder, so that the model can perform context encoding around the event stage and event element corresponding to the target field, reducing the interference of multiple medical processes in the same text on the relation determination.
[0035] The transaction attribution accuracy of the method in this invention reaches 96.58%, which is 6.96 percentage points higher than the direct writing method of Chinese MacBERT-base, GlobalPointer, and double affine relation classification. This difference does not simply come from the model's recognition ability, but because the event transaction envelope limits the medical process attribution of candidate facts through transaction anchors, transaction objects, and transaction time boundaries. When there are multiple medication orders, infusion execution data, or treatment records for the same patient within a short period of time, the direct writing method, although able to identify drugs, abnormal manifestations, and treatment actions, is prone to combining event elements from adjacent medical processes into the same field. This invention uses patient identifiers, visit identifiers, event carrier object identifiers, and fact occurrence time for closure verification, so that candidate facts that do not belong to the current transaction form transaction attribution residuals, and erroneous transaction anchors are eliminated through transaction reselection. Therefore, the improvement in transaction attribution accuracy is significantly greater than the improvement in F1 of event element fragments, and the experimental data is consistent with the technical processing link.
[0036] Regarding the generation of structured form results, the method of this invention achieves an event phase association completeness rate of 91.83% and a field value determination accuracy rate of 93.42%, which are 4.29 percentage points and 4.66 percentage points higher than the Chinese MacBERT-base, GlobalPointer, and double affine relation classification direct writing methods, respectively. The improved event phase association completeness rate stems from the closure check's examination of the connection status between medical execution, abnormal manifestations, injury results, treatment actions, and recovery results. Candidate facts that only have a temporal sequence but do not form the same event, causal relationship, sequence, or treatment response cannot pass directly. Upon detecting missing phases or association errors, the system writes the event phases that have passed the closure check and the extraction results into the field extraction instruction, only re-extracting the missing event phases to supplement event elements that match existing facts. The field value determination accuracy rate is further higher than the event phase association completeness rate because transaction candidate facts and pending confirmation items with closure check residuals are not automatically written into the target form template, avoiding conflicting sources or insufficient evidence becoming determined field values.
[0037] Regarding the source evidence locatability rate, the method of this invention achieves 98.08%, which is 7.77 percentage points higher than the direct writing method using Chinese MacBERT-base, GlobalPointer, and double affine relation classification, and 11.16 percentage points higher than the Chinese MacBERT-base-CRF sequence labeling and field name mapping method. Direct writing methods typically only retain the source of the extracted text or business data. After text segmentation, relative time conversion, and option encoding mapping, some results cannot return the original field or original character position. This invention retains the source system identifier, business data identifier, and source field identifier of the hospital's business data when generating the extracted text, while also retaining the source text identifier and the original character start and end positions of the adverse event reporting data. The source content is reread during closure verification to check the extraction results. When specified evidence is missing, only the corresponding source is supplemented, thus improving the completeness of business field evidence, text fragment evidence, and composite evidence. The remaining 1.92% of unlocatable cases mainly stem from missing source fields after historical business data migration, inconsistent versions of the original reporting text, and the inability to trace cross-system business identifiers, which aligns with the actual data status during the long-term operation of multiple systems in hospitals.
[0038] Processing efficiency data shows that the average structuring time of the BiLSTM-CRF medical entity extraction and dictionary field mapping method is 1.92 seconds, lower than the 2.46 seconds of the method of this invention. This is because the method does not perform event relationship classification, closure verification, and evidence localization, but its accuracy in determining field values is only 77.86%, and each form requires an average of 8.43 fields to be manually confirmed. The Chinese MacBERT-base-CRF sequence labeling and field name mapping method, as well as the Chinese MacBERT-base, GlobalPointer, and double affine relationship classification direct writing method, all require reprocessing 17,836 transaction candidate facts after errors are detected, with average structuring times of 3.71 seconds and 3.28 seconds, respectively. This invention reprocesses only 1472 corresponding facts based on the closure verification residuals, reducing the secondary processing workload by 16364 items, a reduction of 91.75%. Compared to the closest direct write method, the average structured processing time is reduced by 0.82 seconds, a reduction of 25.00%, and the average number of manually confirmed fields is reduced from 4.36 to 2.31, a reduction of 47.02%. Therefore, the one-to-one correspondence between residual types and transaction reselection, target field redirection, event phase re-extraction, source evidence supplementation, and conflict source re-reading not only corrects extraction errors but also avoids repeatedly performing model inference on transaction candidate facts that have already passed closure verification.
[0039] Comprehensive experimental results show that, while only moderately improving the performance of event element fragment recognition, this invention achieves a more significant overall improvement in the accuracy of event attribution, the completeness of event stage association, the accuracy of determining field values, and the locatability of source evidence by relying on event transaction envelope to limit the scope of medical transactions, form field constraints to limit the extraction target, closure verification to block the writing of erroneous facts, residual directional correction to reduce full re-extraction, and field evidence chain to maintain traceability of source. At the same time, it limits the scope of secondary processing to the candidate facts of transactions that generate closure verification residuals, thus taking into account the accuracy, processing efficiency, automatic writing security, and convenience of manual verification in the structured processing of adverse event forms.
[0040] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for structuring form data based on natural language processing, characterized in that, Includes the following steps: Acquire adverse event reporting data and hospital business data, determine the scope of the transaction, generate the event transaction envelope, and obtain the corresponding target form template; Parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task; Based on the task of extracting tasks according to transaction constraints, the medical event extraction model with transaction constraints is used to process in-hospital business data and adverse event reporting data to generate candidate facts of transactions with source evidence. Based on the event transaction envelope and form field constraints, perform closure validation on the candidate facts of the transaction, and generate closure-passed facts and closure validation residuals; Based on the closure check residual, the candidate facts of the transaction are corrected and the closure check is performed again to generate the updated closure pass facts and matters to be confirmed. The updated closure is written into the target form template with facts, linked to source evidence to form a field evidence chain, and combined with the matters to be confirmed to generate structured form data.
2. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The generation of the event transaction envelope and the target form template specifically includes: Unify the patient identification, visit identification, and time format in adverse event reporting data and hospital business data; extract the reporting event type and reporting event time; and generate source data alignment results. Based on the reporting event type and reporting event time in the source data alignment results, filter the in-hospital business data of the same patient and the treatment process, and determine the business data identifier carried by the matched in-hospital business data as the transaction anchor point; Read the in-hospital business data identified by the transaction anchor point, extract the patient identifier, visit identifier, and event carrier object identifier, and combine them to generate a transaction object; By tracing the preceding and following internal business data according to the transaction anchor point and transaction object, the start time and end time of the transaction are determined, and the transaction time boundary is generated. The transaction scope is defined by the transaction object and the transaction time boundary. The event type, transaction anchor point, transaction object and transaction time boundary are written into the event transaction envelope. Dynamic form configuration is selected from the form configuration library and the target form template is generated.
3. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The generation of the transaction constraint extraction task specifically includes: Traverse the ordered fields of the target form template and identify the fields with the input method of automatic writing or automatic suggestion and with fact role identifiers as the target fields for extraction. Traverse back level by level along the parent field identifier of the target field, and connect the fact role identifiers at each level according to the arrangement order in the target form template to generate the fact role path; The form field constraints for the target field to be extracted are composed of the factual role path, data type, option code, allowed source type, and evidence type. The allowed source types in the form field constraints are mapped to the event transaction envelope, and the field reading range of each extraction target field is determined according to the transaction object and transaction time boundary; Generate field extraction instructions according to the target fields, and combine the field extraction instructions into transaction constraint extraction tasks according to the order in the target form template.
4. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The generation of the candidate facts for the transaction specifically includes: Based on the field reading range, the hospital's business data is transcribed into text with source location, and the adverse event reporting data is segmented by sentence and the character position is retained to generate extracted text; The field extraction instructions and the extracted text are used as the model input. The model is input into the transaction constraint medical event extraction model and then contextually encoded using the Chinese MacBERT-base encoder to generate transaction semantic encoding. Input the transaction semantic encoding into the 7-head GlobalPointer layer, and activate the corresponding event element extraction head according to the fact role path to generate event element fragments; Extract the transaction semantic code corresponding to the event element fragments, and generate the preceding and following association categories, extraction results and the time of occurrence of the facts through a 256-dimensional fragment projection layer and a double affine classification layer; Based on the source locations preserved in the extracted text, the target event element fragments are mapped to source evidence, and candidate facts for the transaction are generated.
5. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The generation of the closure through facts and closure verification residuals specifically includes: Based on the source evidence, locate the source data, and verify the transaction attribution and the time of occurrence of the facts in the source data according to the event transaction envelope to generate transaction attribution residuals; Read the form field constraints according to the field identifier, verify the fact role path, event stage, extraction result and source type of the candidate facts of the transaction, and generate fields to carry residuals; According to the reported event type, verify the candidate facts of the transaction at different event stages and their related categories, and generate related residuals; Verify the completeness and locatability of the source evidence according to the evidence type in the form field constraints, and generate source evidence residuals; Summarize transaction attribution residuals, field-carrying residuals, contextual residuals, and source evidence residuals, and generate a closure to verify the residuals using facts and the closure.
6. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The updated closure, through the generation of facts and matters to be confirmed, specifically includes: Based on the transaction attribution residuals, perform transaction reselection on the corresponding transaction candidate facts to generate revised transaction candidate facts; Based on the residual carried by the field, the target field is redirected for the corresponding transaction candidate fact to generate the corrected transaction candidate fact; Based on the residuals of the preceding and following events, the missing or unconnected event phases are re-extracted to generate corrected transaction candidate facts; Based on the source evidence residuals, source data corresponding to the evidence type is extracted to generate corrected source evidence; Based on the fact conflict residuals, the conflict sources are reread and the extraction results are verified to generate corrected candidate facts for transactions or matters to be confirmed. Only the revised transaction candidate facts are re-validated to generate updated closure-passed facts and pending confirmation items.
7. The method for structuring form data based on natural language processing according to claim 1, characterized in that, The generation of the structured form data specifically includes: The updated closure is written into the corresponding field of the target form template according to the field identifier, generating a definite field value; By concatenating the values of each determined field in the order of source evidence, candidate facts of the transaction, closure verification results, and target field, a field evidence chain is generated. Write the items to be confirmed into the confirmation area, which is isolated from the field values, and generate the field confirmation content; The template identifier, version number, determined field values, field evidence chain, and field confirmation content of the target form template are combined to generate structured form data.
8. A form data structuring system based on natural language processing, comprising executing the form data structuring method based on natural language processing as described in any one of claims 1 to 7, characterized in that, include: The transaction configuration module is used to obtain adverse event reporting data and hospital business data, determine the transaction scope, generate event transaction envelopes, and obtain the corresponding target form templates. The task generation module is used to parse the target form template to generate form field constraints, and combine the form field constraints with the event transaction envelope into a transaction constraint extraction task. The transaction fact extraction module is used to process in-hospital business data and adverse event reporting data according to the transaction constraint extraction task and the transaction constraint medical event extraction model to generate transaction candidate facts with source evidence. The closure validation module is used to perform closure validation on candidate facts of transactions based on the event transaction envelope and form field constraints, and generate closure-passed facts and closure validation residuals. The residual correction module is used to correct the candidate facts of the residual verification transaction based on the closure verification and to perform closure verification again, generating updated closure-passed facts and matters to be confirmed. The structured form generation module is used to write the updated closure into the target form template with facts, associate source evidence to form a field evidence chain, and generate structured form data by combining the matters to be confirmed.
