Drug data consistency verification method and system
By generating a set of rule constraint indexes, a constraint decision network, and a set of conflict paths, and combining the Rete and AC-3 algorithms, the problems of field constraint binding and conflict location in drug data consistency verification are solved, achieving efficient consistency verification of drug data and stability of business applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGZHOU HEALTH HIGHER VOCATIONAL & TECH SCHOOL
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for verifying the consistency of drug data lack effective field constraint binding mapping and sequential reference relationships, making it difficult to locate conflicts. Missing fields are not uniformly occupied, combinational logic conflicts are difficult to identify, and there is a lack of executable value convergence basis, resulting in business calculation errors and inventory accounting anomalies.
By generating a set of rule constraint indexes, a constraint decision network, a set of rule conflict paths, and a set of conflict constraint attributions, the Rete algorithm and the AC-3 algorithm are used to perform equivalence checks, inequality checks, and candidate value verifications for drug fields, ensuring the traceability and executability of field consistency checks.
It achieves efficient verification of drug data consistency, improves the granularity of conflict localization and the completeness of attribution, and ensures the consistency of drug data values in the information system and the security of business applications.
Smart Images

Figure CN122019522A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data consistency verification technology, and in particular to a method and system for verifying the consistency of pharmaceutical data. Background Technology
[0002] The field of data consistency verification technology aims to perform logical comparison processing on the field values of the same business object in multiple data records, multiple data tables and multiple storage locations by setting up consistency judgment rules. This is to determine whether the data status meets the consistency constraints, identify and eliminate field conflicts, logical contradictions and version mismatches, and ensure the uniformity of data values, logical integrity and business availability of data in the storage, retrieval and flow process of information systems. It also avoids business calculation errors, process execution deviations and management risks caused by data inconsistency.
[0003] The purpose of a drug data consistency verification method is to identify and locate value conflicts and logical mismatches in drug data by performing consistency judgment on key fields of drug business objects in multiple data storage locations. This is to prevent business processing errors caused by inconsistencies in core data such as drug name, approval number, specifications, dosage form and manufacturer, and to ensure the consistency of drug data values, logical reliability and business application security in the information system.
[0004] This system relies on preset consistency rules to perform logical comparisons of field values across multiple records, tables, and storage locations. Its operation is heavily reliant on static comparison and result output. However, it suffers from insufficient granularity in field constraint splitting, a lack of binding mapping between rule sources and field constraints, and a lack of sequential referencing relationships. This makes it difficult to aggregate and manage constraint differences for the same field under different rules, hindering the formation of a traceable index. The judgment process lacks a continuously propagating judgment chain, and in scenarios involving field changes, it often employs full scans or repeated comparisons, making it difficult to record and verify conflict-triggered fields and the judgment path. Conflict localization often remains at the level of displaying inconsistent fields, lacking records of the initial inconsistency location and range of differences, and lacking aggregated views of source identifiers. The lack of a unified placeholder and fixed field order concatenation mechanism for missing fields leads to misaligned field order when comparing records from multiple sources, resulting in incorrect difference judgments. The coverage of combination constraint verification is insufficient. When dosage forms and specifications have paired restrictions, relying solely on the consistency of a single field can easily miss combination logic conflicts. When there is a boundary between the manufacturer and the drug name, there is a lack of corresponding relationship verification links, resulting in consistency at the field level but contradictions at the combination level. There is a lack of candidate value convergence and elimination record management. Simply outputting inconsistent results does not provide an executable basis for value convergence, causing unstable repair actions and potentially introducing secondary inconsistencies, which in turn leads to deviations in business calculation methods, abnormal inventory accounting, and blocked process approvals. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a method and system for verifying the consistency of drug data.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for verifying the consistency of drug data, comprising the following steps:
[0007] S1: Based on drug rule entries, read the approval number, drug name, dosage form, specification, manufacturer, and version identifier, split the field constraint content, collect the same field validation items, complete the binding mapping between rule identifier and constraint unit, and generate a rule constraint index set;
[0008] S2: Based on the rule constraint index set, perform equivalence and inequality checks on the drug field, verify each combination of dosage form and specification, construct the drug key connection order, complete the arrangement and binding of the relationship between the judgment items, and establish a constraint judgment network.
[0009] S3: Based on the constraint determination network, write the drug field change record, clear the old value of the corresponding field and replace it with the new value, trigger the field determination item by item, filter the records with consistent drug keys, pass the determination flag along the connection order, record the complete trigger path and merge duplicate conflicts, and generate a set of rule conflict paths.
[0010] S4: Based on the set of conflicting rules, lock the set of records corresponding to the approval number, splice the core fields of the drug in a fixed order, fill in the missing field placeholders, compare the results of multi-source field combinations layer by layer, drill down the difference branches and mark the field positions to obtain the field difference location set;
[0011] S5: Based on the field difference location set and rule conflict path set, filter candidate values for drug fields, check the matching relationship between dosage form and specification, verify the associated values of manufacturers, perform candidate value elimination and rollback switching, collect the sources of trigger constraints, and generate a conflict constraint attribution set.
[0012] As a further embodiment of the present invention, the rule constraint index set includes rule identifier, field identifier, constraint type identifier, field combination identifier and source limitation identifier; the constraint determination network includes field determination node identifier, field connection node identifier, node sequence identifier and drug key association identifier; the rule conflict path set includes rule identifier, drug key identifier, trigger field identifier set, source identifier set and determination node sequence identifier; the field difference location set includes field identifier, difference source identifier set and field sequence position identifier; and the conflict constraint attribution set includes constraint identifier, conflict field identifier, candidate value source identifier and conflict type identifier.
[0013] As a further aspect of the present invention, the specific steps for generating the rule constraint index set are as follows:
[0014] Based on drug rule entries, the approval number, drug name, dosage form, specification, manufacturer, and version identifier are read. For each rule entry, the field constraint content is broken down item by item according to the field identifier. Field equality restrictions, field inequality restrictions, and field combination restrictions are classified and stored according to the field identifier. Constraint items under the same field identifier are merged and recorded to obtain a set of field constraint units.
[0015] Based on the set of field constraint units, each field constraint unit and its corresponding rule identifier are written into the binding structure one by one. A sequential index is established for the field constraint units under the same rule identifier and a rule-level reference relationship is formed. The mapping relationship between the rule identifier and the field constraint unit is stored in a fixed manner to generate a rule constraint index set.
[0016] As a further aspect of the present invention, the specific steps for generating the constraint determination network are as follows:
[0017] Based on the rule constraint index set, extract the field constraint units under the rule identifier, perform equivalence and inequality judgment on the drug field values, compare the dosage form value and specification value with the allowed combination list in a pairwise manner, record the judgment results in the field order and generate a field judgment result sequence to obtain the field judgment sequence set.
[0018] Based on the field determination sequence set, the field determination results are grouped according to the drug key identifier. The determination results under the same drug key are connected and arranged according to the rule constraint order, the dependencies are written and the transmission order is fixed. All rule-corresponding connection structures are summarized to establish a constraint determination network.
[0019] As a further aspect of the present invention, the specific steps for generating the rule conflict path set are as follows:
[0020] Based on the constraint determination network, the system receives drug field change records, locates the corresponding drug key identifier and field identifier, performs a deletion operation on existing field values and writes new field values, establishes a correspondence between the changed fields and their associated determination nodes, forms a field input set for subsequent determination, and generates a field determination input set.
[0021] Based on the field judgment input set, the Rete algorithm is used to match the field input under the same drug key item by item according to the judgment node order, filter out records with inconsistent drug keys, convert the matching result into a judgment mark and pass it along the node connection order. During the transmission process, the combination of field identifier and node identifier is continuously recorded to obtain the judgment transmission path set.
[0022] Based on the set of determination transmission paths, the rule identifier, drug key identifier, and trigger field identifier are extracted from the records that reach the complete path. The same rule identifier and drug key combination are merged repeatedly. The complete nodes are written sequentially into the conflict record structure to generate a set of rule conflict paths.
[0023] As a further aspect of the present invention, the Rete algorithm is employed to distribute the field judgment input set to the condition node buffer according to the field identifier. For each field input, equality judgment and inequality judgment are performed to generate a hit token. The token is written to the left and right buffers of the connection node according to the drug key identifier. Connection matching is performed on the left and right buffers within the same connection node according to the drug key identifier. When the connection is successful, the field bindings are merged and a new token is generated. The new token continues to be written to the buffers of subsequent connection nodes according to the connection order and the connection matching is repeated. The rule identifier, trigger field identifier set, and node passing sequence of the token arriving at the terminal node are written into the judgment transmission path set.
[0024] As a further aspect of the present invention, the specific steps for generating the field difference location set are as follows:
[0025] Based on the set of conflicting rules, the approval numbers in the conflicting records are filtered and the corresponding multi-source record set is locked. For each approval number, the approval number, drug name, dosage form, specification, manufacturer, and version identifier are extracted. The field values are arranged in the order of the preset fields. Fixed placeholder values are written for missing fields. Each record is converted into a combination structure with consistent field order, and a set of field order combinations is generated.
[0026] Based on the field order combination set, the multi-source combination structure under the same approval number is compared item by item according to the field order. The position where the field value first appears inconsistent is identified. For inconsistent fields, segmented comparison is performed to confirm the range of difference. The field identifier and source identifier corresponding to the inconsistent field are written into the positioning structure to obtain the field difference positioning set.
[0027] As a further aspect of the present invention, the specific steps for generating the conflict constraint attribution set are as follows:
[0028] Based on the field difference location set and the rule conflict path set, the field identifiers involved in the conflict are extracted, the values of multiple source fields are locked, the field values are written into the candidate set according to the field identifier, and the source identifier and the number of occurrences are recorded for each candidate value, forming a set of field values for constraint verification, and thus obtaining the field candidate value set.
[0029] Based on the candidate value set of the field, the AC-3 algorithm is used to check the dosage form value and specification value in pairs, and to check the correspondence between the manufacturer value and the drug name value. Candidate values that cannot meet the correspondence are deleted, and the trigger field identifier and source identifier are recorded simultaneously to obtain the constraint elimination record set.
[0030] Based on the constraint elimination record set, for fields that still retain multiple candidate values, perform a step-by-step fixing and rollback switching operation, repeatedly perform field pairing and verification, collect the field identifiers, source identifiers and associated constraint identifiers that cause candidate values to be continuously deleted, write the above information into the attribution structure, and generate a conflict constraint attribution set.
[0031] As a further aspect of the present invention, the AC-3 algorithm first initializes the arc queue to be checked. Each arc in the arc queue consists of a field pair identifier and a corresponding constraint identifier. The field pair includes dosage form and specification, manufacturer and drug name. An arc is taken out sequentially from the arc queue. The candidate value set of the previous field is traversed. For each candidate value, at least one value that satisfies the allowed correspondence mapping table is searched in the candidate value set of the next field. If no value that satisfies the relationship is found, the candidate value is deleted from the candidate set of the previous field, and the field identifier and source identifier corresponding to the deleted candidate value are recorded. When a deletion operation occurs, all remaining arcs that are the next field are added back to the arc queue to trigger a chain check. The above process is repeated until the arc queue is empty and the candidate value set of any field is deleted to be empty. All deleted records and the triggered constraint relationships are summarized to form a constraint elimination record set.
[0032] A drug data consistency verification system, the drug data consistency verification system being used to execute the above-described drug data consistency verification method, the system comprising:
[0033] Rule Index Module: Based on drug rule entries, it reads approval number, drug name, dosage form, specification, manufacturer, and version identifier, splits field constraint content, aggregates the same field validation items, completes the binding mapping between rule identifiers and constraint units, and generates a rule constraint index set;
[0034] Decision network module: Based on the rule constraint index set, it performs equivalence and inequality checks on the drug field, verifies each combination of dosage form and specification, constructs the drug key connection order, completes the arrangement and binding of the relationship between the decision items, and establishes the constraint decision network;
[0035] Conflict triggering module: Based on the constraint determination network, write the drug field change record, clear the old value of the corresponding field and replace it with the new value, trigger the field determination item by item, filter the records with consistent drug keys, pass the determination mark along the connection order, record the complete triggering path and merge duplicate conflicts, and generate a set of rule conflict paths;
[0036] The difference location module: Based on the set of conflicting rules, it locks the set of records corresponding to the approval number, splices the core fields of the drug in a fixed order, fills in the missing field placeholders, compares the results of field combinations from multiple sources layer by layer, drills down the difference branches and marks the field positions to obtain the field difference location set;
[0037] Constraint Attribution Module: Based on the field difference location set and rule conflict path set, it filters candidate values for drug fields, verifies the pairing relationship between dosage form and specification, checks the associated values of manufacturers, performs candidate value elimination and rollback switching, collects the sources of trigger constraints, and generates a conflict constraint attribution set.
[0038] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0039] In this invention, the Rete algorithm is introduced into the determination stage to participate in the determination and transmission process after field change is triggered. The screening of consistent drug key records, the matching of determination node order, the transmission of determination mark along the connection order and the continuous recording of trigger path are integrated into the same chain process. This makes the conflict location information include field identifier, node identifier and connection order information. The conflict result locks the multi-source record set according to the approval number and splices the field combination structure according to the fixed field order and fills in the missing placeholder value. This makes the multi-source combination have a unified order and supports item-by-item comparison. In the difference identification stage, the first inconsistent field location is performed on the combination structure under the same approval number and the difference range is confirmed by segment comparison. This makes the difference location information include field identifier, source identifier and difference range.
[0040] In this invention, the AC-3 algorithm is introduced into the constraint verification process during the candidate value convergence stage. The dosage form value and specification value are checked item by item according to the pairwise relationship, and the correspondence between the manufacturer value and the drug name value is verified. Candidate values that cannot meet the constraint relationship are deleted and the trigger field identifier and source identifier are recorded simultaneously. By switching between item-by-item fixing and rollback, the pairwise verification between fields is repeated. The candidate continuous deletion link is collected and written into the attribution structure, so that the conflict attribution information simultaneously covers the candidate set change sequence, the trigger constraint source and the field association relationship. This promotes the transformation of consistency verification from static comparison to indexable rule constraint driven, path traceable and passable and constraintable consistency convergence verification, thereby improving the granularity of conflict location and the completeness of attribution. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the workflow of the present invention;
[0042] Figure 2 This is a system flowchart of the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0044] Example 1
[0045] Please see Figure 1 This invention provides a technical solution: a method for verifying the consistency of drug data, comprising the following steps:
[0046] S1: Based on drug rule entries, read the approval number, drug name, dosage form, specification, manufacturer, and version identifier, split the field constraint content, collect the same field validation items, complete the binding mapping between rule identifier and constraint unit, and generate a rule constraint index set;
[0047] S2: Based on the rule constraint index set, perform equality and inequality checks on the drug field, verify each combination of dosage form and specification, construct the drug key connection order, complete the arrangement and binding of the relationship between the judgment items, and establish a constraint judgment network.
[0048] S3: Based on the constraint decision network, write the drug field change record, clear the old value of the corresponding field and replace it with the new value, trigger the field decision item by item, filter the records with consistent drug keys, pass the decision flag along the connection order, record the complete trigger path and merge duplicate conflicts, and generate a set of rule conflict paths;
[0049] S4: Based on the set of rule conflict paths, lock the set of records corresponding to the approval number, splice the core fields of the drug in a fixed order, fill in the missing field placeholders, compare the results of multi-source field combinations layer by layer, drill down the difference branches and mark the field positions to obtain the field difference location set;
[0050] S5: Based on the field difference location set and rule conflict path set, filter candidate values for drug fields, check the matching relationship between dosage form and specification, verify the associated values of manufacturers, perform candidate value elimination and rollback switching, collect the sources of trigger constraints, and generate a conflict constraint attribution set.
[0051] The rule constraint index set includes rule identifier, field identifier, constraint type identifier, field combination identifier, and source limitation identifier. The constraint decision network includes field decision node identifier, field connection node identifier, node sequence identifier, and drug key association identifier. The rule conflict path set includes rule identifier, drug key identifier, trigger field identifier set, source identifier set, and decision node sequence identifier. The field difference location set includes field identifier, difference source identifier set, and field sequence position identifier. The conflict constraint attribution set includes constraint identifier, conflict field identifier, candidate value source identifier, and conflict type identifier.
[0052] The specific steps for generating the rule constraint index set are as follows:
[0053] Based on drug rule entries, the approval number, drug name, dosage form, specification, manufacturer, and version identifier are read. For each rule entry, the field constraint content is broken down item by item according to the field identifier. Field equality restrictions, field inequality restrictions, and field combination restrictions are classified and stored according to the field identifier. Constraint items under the same field identifier are merged and recorded to obtain a set of field constraint units.
[0054] Based on the set of field constraint units, each field constraint unit and its corresponding rule identifier are written into the binding structure one by one. A sequential index is established for the field constraint units under the same rule identifier and a rule-level reference relationship is formed. The mapping relationship between the rule identifier and the field constraint unit is stored in a fixed manner to generate a set of rule constraint indexes.
[0055] Based on drug rule entries, a regular expression matching parsing method is used to read the approval number, drug name, dosage form, specification, manufacturer, and version identifier field by field. This method includes a set of matching rules: the approval number matching rule starts with a letter followed by 8 digits; the drug name matching rule is a combination of Chinese characters, letters, or numbers with a length of 2 to 64; the dosage form matching rule is tablets, capsules, injections, or granules; the specification matching rule is a string of numbers followed by mg, g, or ml; the manufacturer matching rule is a combination of Chinese characters, letters, or numbers with a length of 4 to 128; and the version identifier matching rule starts with 'v' followed by the major version number and then the minor version number. For each rule entry, the field constraints are split item by item according to the field identifier. The splitting process uses a string segmentation method, with the field separator set to a vertical bar (pipe) and segmented scanning is performed. The constraint delimiter is set to comma and secondary segmentation is performed. Each segment of field constraints is written to the field constraint queue. The field constraints are classified using a conditional splitting method. During the classification process, field constraints containing equal signs are written to the equal value constraint set, field constraints containing inequality signs are written to the inequality constraint set, and field constraints containing AND signs are written to the combination constraint set. The field equal value constraint set, field inequality constraint set, and field combination constraint set are categorized and stored according to field identifiers. The classification process uses a key-value mapping storage method, using the field identifier as the key and the list of constraint entries as the value to write to the mapping table. Constraint items under the same field identifier are merged. The merging process uses a sequential deduplication merging method, traversing the list of constraint entries in the order of appearance, skipping duplicate constraint entries, and appending non-duplicate constraint entries to generate a field constraint unit set.
[0056] Based on the set of field constraint units, a sequential binding write method is used to write each field constraint unit and its corresponding rule identifier into the binding structure one by one. The writing process uses record write operations, writing the rule identifier into the rule identifier column, the field identifier into the field identifier column, the list of constraint entries into the constraint content column, and the binding sequence number into the sequential index column. The initial value of the sequential index column is set to 1 and increments with each written record. A sequential index is established for field constraint units under the same rule identifier, forming a rule-level reference relationship. The reference relationship construction process uses a list reference organization method, using the rule identifier as the reference entry and adding the field constraint unit reference to the reference list in ascending order of the sequential index. The mapping relationship between the rule identifier and the field constraint unit is permanently stored. The permanent storage process uses an ordered key index storage method, using the rule identifier as the index key and the list of field constraint unit references as the index value to perform persistent writing, generating a rule constraint index set.
[0057] The specific steps for generating the constraint decision network are as follows:
[0058] Based on the rule constraint index set, extract the field constraint units under the rule identifier, perform equivalence and inequality judgment on the drug field values, compare the dosage form value and specification value with the allowed combination list in a pairwise manner, record the judgment results in the field order and generate a field judgment result sequence to obtain the field judgment sequence set.
[0059] Based on the field judgment sequence set, the field judgment results are grouped according to the drug key identifier. The judgment results under the same drug key are connected and arranged according to the rule constraint order. The dependencies are written and the transmission order is fixed. The connection structure corresponding to all rules is summarized to establish a constraint judgment network.
[0060] Based on the rule constraint index set, an index-order traversal method is used to extract the constraint units of each field under the rule identifier. During the traversal, each rule identifier is read sequentially, and the field identifier and constraint entry list are retrieved in ascending order of index. Equality and inequality checks are performed on the drug field values. The check process uses a strict string comparison method: the drug field value is compared character-by-character with the equivalent constraints in the constraint entry list, and the comparison marker is recorded as EQ_PASS or EQ_FAIL. Similarly, the drug field value is compared character-by-character with the inequality constraints in the constraint entry list, and the comparison marker is recorded as NEQ_PASS or NEQ_FAIL. EQ_PASS and NEQ_PASS are written to the field judgment cache, and EQ_FAIL and NEQ_FAIL are also written to the field judgment cache. Dosage form values and specification values are checked in pairs. The allowed combination list is compared item by item using a pairwise key matching method. The dosage form value is written into the first position of the combination key and the specification value is written into the second position of the combination key. The allowed combination list is read line by line and the dosage form and specification are connected by a vertical bar to form a combination key list. The combination key and the combination key list are compared character by character and the matching mark is recorded as PAIR_MATCH or PAIR_MISMATCH. PAIR_MATCH or PAIR_MISMATCH is written into the field judgment cache in field order. The judgment results are recorded in field order and a field judgment result sequence is generated. The recording process uses a sequential writing method. The field identifier sequence is written from left to right and a corresponding mark is written after each field identifier and the writing position is fixed. The field judgment result sequence is written into the sequence set storage area to obtain the field judgment sequence set.
[0061] Based on the field decision sequence set, a key grouping and aggregation method is used to group the field decision results according to the drug key identifier. During the grouping process, the field decision sequence set is read line by line, the drug key identifier is extracted and written to the grouping mapping table, the drug key identifier is set as the mapping key, and the field decision result sequence is set as the mapping value list and appended. Decision results under the same drug key are connected and arranged according to the rule constraint order. The connection process uses a sequential concatenation method, retrieving the field decision result sequence in ascending order of the rule constraint index and connecting them into a single connection string according to the writing order. Sequence boundary markers are inserted into the connection string using hash symbols as delimiters, and predecessor-successor dependencies are written with a fixed propagation order. The dependency writing process uses a predecessor-successor marking method, writing predecessor marker PRE and successor marker NEXT to adjacent sequences in the connection string, along with the rule identifier and the order index value. PRE and NEXT are written to the dependency table with a fixed record order. All rule-corresponding connection structures are summarized using a list summary writing method, traversing the mapping table according to the drug key identifier order and writing the connection string and dependency table records into the summary structure to establish a constraint decision network.
[0062] The specific steps for generating a set of conflicting rules are as follows:
[0063] Based on the constraint decision network, the system receives drug field change records, locates the corresponding drug key identifier and field identifier, performs a deletion operation on the existing field values and writes the new field values, establishes a correspondence between the changed fields and their associated decision nodes, forms a field input set for subsequent decision-making, and generates a field decision input set.
[0064] Based on the field judgment input set, the Rete algorithm is used to match the field input under the same drug key item by item according to the judgment node order, filter out records with inconsistent drug keys, convert the matching results into judgment tags and pass them sequentially along the node connection order. During the transmission process, the combination of field identifier and node identifier is continuously recorded to obtain the judgment transmission path set.
[0065] Based on the decision transmission path set, the rule identifier, drug key identifier and trigger field identifier are extracted from the records that reach the complete path. The same rule identifier and drug key combination are merged repeatedly. The complete node is written into the conflict record structure in sequence to generate a rule conflict path set.
[0066] Based on a constraint decision network, a change event parsing method is used to receive drug field change records. The receiving process reads the change records line by line and segments them with commas into drug key identifier segment, field identifier segment, old field value segment, and new field value segment. Space removal is performed on both the drug key identifier and field identifier segments. The corresponding drug key identifier and field identifier are located using a key-value indexing method. The drug key identifier is used as the index key to retrieve the drug node table in the constraint decision network and returns a node pointer. The field identifier is used as the index key to retrieve the field node table and returns a field pointer. Existing field values are deleted, and new field values are written. The deletion operation uses a fixed-length overwrite deletion method, replacing the old field value with a new one. The storage unit where the field value is located is marked as DEL, and the length of the old field value is written to the length column and the content of the old field value is set to an empty string. The writing operation adopts the sequential writing method. The new field value is written to the field value column, the writing timestamp column, and the writing source column. The modified field is established to correspond to its associated decision node. The establishment process adopts the association table writing method. The field node mapping table is constructed and the drug key identifier, field identifier, and decision node identifier are written and the mapping sequence number is written to form a set of input fields for subsequent decision fields. The set construction process adopts the set deduplication method. The drug key identifier plus the field identifier is used to form a composite key and duplicate composite keys are overwritten and the latest new field value is retained to generate the field decision input set.
[0067] Based on the field-determined input set, the Rete algorithm is used to construct a matching network and perform node-by-node matching. The construction process includes creating an Alpha node table and a Beta node table, writing node identifiers and node order indices. The Alpha node table stores field identifiers, constraint types, and constraint values, and writes comparison symbols, including equal and inequality signs. The Beta node table stores node connection relationships, writes left and right input node identifiers, and writes connection order indices. A working memory writing method is used to write the field-determined input set into working memory. During the writing process, for each input record, a drug key identifier, field identifier, field value, input sequence number, and update timestamp are written. The Alpha node matching method is used to match field inputs under the same drug key item by item according to the decision node order. The matching process performs exact matching on field identifiers and character-by-character comparison between field values and constraint values, outputting a matching marker A_. PASS or A_FAIL filters out records with inconsistent drug keys. The filtering process uses a key consistency filtering method, which performs string comparison between the drug key identifier of the input record and the drug key identifier bound to the node, and writes a DROP flag for inconsistent records. The matching result is converted into a decision flag and passed sequentially along the node connection order. The conversion process uses a flag writing method, which converts A_PASS to T and A_FAIL to F and writes them into the node identifier column. The connection passing operation is performed along the Beta node connection order. The passing operation uses a two-input connection method, which performs an AND operation on the left input flag and the right input flag and outputs B_PASS or B_FAIL and writes it into the output queue. During the passing process, the combination of field identifier and node identifier is continuously recorded. The recording process uses a path append writing method, which writes the field identifier and node identifier into the path list in sequence, writes the path number, and writes the drug key identifier to obtain the decision passing path set.
[0068] Based on the decision-making path set, a complete path determination method is used to filter records reaching complete paths. The filtering process compares the path list length with the rule path length using integers and marks matching records as FULL_PATH. For FULL_PATH records, rule identifiers, drug key identifiers, and trigger field identifiers are extracted. The extraction process uses a field position reading method, reading the rule identifier, drug key identifier, and trigger field identifier columns in a fixed column order and writing them to the extraction result table. For identical rule identifier and drug key combinations, a duplicate merging process is performed. The merging process uses a composite key deduplication merging method, forming a composite key with the rule identifier and drug key identifier, and performing an overwrite merging on duplicate composite key records, retaining the trigger field identifier list and appending it in the writing order. Complete nodes are sequentially written into the conflict record structure. The writing process uses a sequential conflict writing method, writing node identifiers, field identifiers, decision flags, rule identifiers, and drug key identifiers to the path list in ascending order of path number, along with the conflict record sequence number and record timestamp, generating a rule conflict path set.
[0069] The Rete algorithm is used to distribute the field judgment input set to the condition node buffer according to the field identifier. For each field input, equality and inequality judgments are performed and a hit token is generated. The token is written to the left and right buffers of the connection node according to the drug key identifier. Connection matching is performed on the left and right buffers of the same connection node according to the drug key identifier. When the connection is successful, the field bindings are merged and a new token is generated. The new token is written to the buffer of the subsequent connection node according to the connection order and the connection matching is repeated. The rule identifier, trigger field identifier set and node passage sequence of the token arriving at the terminal node are written into the judgment transmission path set.
[0070] The Rete algorithm, according to the formula:
[0071]
[0072] in: The drug key is Time Each decision node outputs a decision flag value. This indicates that the node is in the node sequence. Sequential index and value range , Indicates drug key The value is used to limit the set of records under the same drug key. Indicates the index of the decision node. From 1 to Performs chain multiplication and is used to represent term-by-term matching cumulative constraints. This indicates the index variable of the decision node involved in the multiplication calculation, and its value range is... , This indicates an indicator function that takes the value 1 when the condition within the parentheses is true and takes the value 0 when the condition is false. Indicates the first Input records The corresponding value can be retrieved from the drug key field. Indicates the field to determine the input set The index is Input records, The drug key is Field identifiers in records Enter the corresponding field value. Indicates the first Each decision node is bound to a field identifier, which is used to locate the field items participating in the matching. Indicates the first Each decision node has a preset field decision condition value, which is used to perform equality matching with the field input value;
[0073] Execution process: in the first stage In the first iteration, the drug bond consistency indicator is calculated. If and only if the input record The drug key equals the target drug key. The value is 1 if the condition is met, otherwise it is 0 and the product result is fixed at 0. Then the field value matching indicator is calculated. ,in By drug key Extracting segment identifiers from a record set Enter the corresponding field value and match it with the node condition value. Perform an equality check; if equal, assign a value of 1; if unequal, assign a value of 0, and fix the product result to 0 for each round. The two indicator terms are then combined through multiplication to obtain the first term. The wheel node constraint results are then compared with the previous results. The cumulative results of each round are multiplied together and a new cumulative value is recorded; when any indicator in any round is 0, the cumulative value becomes 0, indicating that it is the 1st round. If a decision node experiences a discrepancy in the drug key or a mismatch in the field, the process will terminate, and subsequent... to The cycle multiplication remains at 0, which is equivalent to stopping the drug key in the Rete network. The decision marker is passed to subsequent nodes, when all nodes are... When both indicators are 1, the cumulative product result is... Characterizing drug bonds are consistent and nodes 1 to 2 are consistent. All bound fields meet the condition value matching, thus... As the first The node outputs a decision flag and connects along the node. The transmission is used to drive the calculation of subsequent nodes and synchronously support the determination of the transmission path record.
[0074] The specific steps for generating the field difference location set are as follows:
[0075] Based on the rule conflict path set, the approval number in the conflict records is filtered and the corresponding multi-source record set is locked. For each approval number, the approval number, drug name, dosage form, specification, manufacturer and version identifier are extracted. The field values are arranged in the preset field order. Fixed placeholder values are written for missing fields. Each record is converted into a combination structure with consistent field order, and a field order combination set is generated.
[0076] Based on the field order combination set, the multi-source combination structure under the same approval number is compared item by item according to the field order. The position where the field value first appears inconsistent is identified. For inconsistent fields, segmented comparison is performed to confirm the range of difference. The field identifier and source identifier corresponding to the inconsistent field are written into the positioning structure to obtain the field difference positioning set.
[0077] Based on the rule conflict path set, a conflict record filtering method is used to screen the approval numbers in conflict records and lock the corresponding multi-source record set. The filtering process reads the rule conflict path set line by line and locates the approval number field. The approval number field is then processed to remove spaces and undergo length validation. The length validation requires 9 characters, and records that do not meet the 9-character requirement are marked with a SKIP tag, while records that meet the 9-character requirement are marked with a KEEP tag. A key aggregation positioning method is used to lock the corresponding multi-source record set. The positioning process uses the approval number as the aggregation key, writes the source identifier into the source list, and writes the record identifier into the record list. For each approval number, the following information is extracted: approval number, drug name, dosage form, specification, manufacturer, and version identifier. The extraction process uses a fixed field position reading method, reading the approval number field in order and writing it to position 1 of the field array, then reading the drug name field and writing it to position 1 of the field array. 2. Read the dosage form field and write it to field array position 3. Read the specification field and write it to field array position 4. Read the manufacturer field and write it to field array position 5. Read the version identifier field and write it to field array position 6. Arrange the field values in the preset field order. The arrangement process uses the array order writing method. The array length is set to 6 and the subscript mapping is fixed from 1 to 6. Write fixed placeholder values for missing field positions. The placeholder writing process uses the null value judgment writing method. Perform null string judgment on each position of the field array and write the placeholder value NA for the null string. Retain the original field value for the non-null string. Convert each record into a field order consistent combination structure. The conversion process uses the fixed length string concatenation method. Concatenate the field array in the order of positions 1 to 6 and insert field boundary markers with vertical lines as connectors. Write the combination structure into the combination structure list and write the approval number and source identifier to generate the field order combination set.
[0078] Based on the field order combination set, a same-key grouping comparison method is used to compare multi-source combination structures under the same approval number item by item according to field order. The comparison process involves grouping and reading the approval number, arranging the combination structures according to the source identifier order, and writing them into the comparison queue. A field position comparison method is used to identify the first inconsistency in field values. The comparison process takes the first combination structure in the comparison queue as the baseline combination and takes values sequentially from field position 1 to 6. For the remaining combination structures, a character-by-character comparison is performed using the same field position. In the character-by-character comparison process, each field value is scanned incrementally from 1 using the character index, and DIFF markers are written for positions where different characters appear. The field position number is recorded as the first inconsistency position number. The inconsistent fields continue to be compared segment by segment to confirm the range of differences. The segment comparison process adopts the continuous inconsistent interval scanning method, starting from the first inconsistent field position and scanning sequentially to field position 6. For each field, consistency judgment is performed and the interval start position and interval end position are written. The field identifier and source identifier corresponding to the inconsistent field are written into the positioning structure. The writing process adopts the positioning record writing method, writing the approval number into the positioning record column, mapping the field position number to the field identifier and writing it into the field identifier column, writing the source identifier into the source identifier column, writing the interval start position and interval end position into the difference range column, and writing the benchmark field value and the control field value into the value comparison column to obtain the field difference positioning set.
[0079] The specific steps for generating a conflict constraint attribution set are as follows:
[0080] Based on the field difference location set and the rule conflict path set, the field identifiers involved in the conflict are extracted, the corresponding multi-source field values are locked, the field values are written into the candidate set according to the field identifier, and the source identifier and occurrence frequency are recorded for each candidate value, forming a field value set for constraint verification, and thus obtaining the field candidate value set;
[0081] Based on the candidate value set of the field, the AC-3 algorithm is used to check the dosage form value and specification value in pairs, and to check the correspondence between the manufacturer value and the drug name value. Candidate values that cannot meet the correspondence are deleted, and the trigger field identifier and source identifier are recorded simultaneously to obtain the constraint removal record set.
[0082] Based on the constraint removal record set, for fields that still retain multiple candidate values, perform item-by-item fixing and rollback switching operations, repeatedly perform field pairing and verification, collect the field identifiers, source identifiers and associated constraint identifiers that cause candidate values to be continuously deleted, write the above information into the attribution structure, and generate a conflict constraint attribution set.
[0083] Based on the field difference location set and the rule conflict path set, a conflict field intersection extraction method is used to extract the field identifiers involved in the conflict. The extraction process reads each record in the field difference location set and extracts the field identifier column, writing it into field identifier list A. Similarly, it reads each record in the rule conflict path set and extracts the field identifier column, writing it into field identifier list B. A sequential intersection scan is then performed on field identifier list A and field identifier list B, outputting the intersection field identifier list C. Correspondingly, the values of multi-source fields are locked. The locking process uses a key mapping method, retrieving the multi-source record set using the approval number and field identifier as a composite key and returning the source identifier and field value pairs. The field values are then sorted according to... The field identifier is written to the candidate set. The writing process adopts the field bucket writing method, which uses the field identifier as the bucket key and the field value list as the bucket value to perform append writing. For each candidate value, the source identifier and the number of occurrences are recorded. The recording process adopts the counting accumulation method, which performs item-by-item traversal of the field value and uses the field identifier plus the field value plus the source identifier to form a count key. The initial count value is set to 0 and incremented by 1 each time it appears, forming a set of field values used for constraint verification. The set construction process writes candidate entries, field identifiers, field values, source identifier lists, and occurrence count lists to each field identifier bucket, thus obtaining the field candidate value set.
[0084] Based on the candidate value set of fields, the AC-3 algorithm is used to perform arc consistency checks. The check process establishes a variable set, a value domain set, and a constraint arc queue. The variable set includes dosage form, specification, manufacturer, and drug name variables. The value domain set is read from the candidate value set and written into the variable value domain list. During the constraint arc queue initialization process, arcs from dosage form to specification and vice versa are written into the queue, as are arcs from manufacturer to drug name and vice versa. A queue dequeue method is used to retrieve arcs item by item and perform the check operation. Dosage form and specification values are checked item by item according to their pairwise relationship. During the check process, candidate dosage form values are retrieved item by item from the dosage form variable value domain list, and candidate specification values are retrieved item by item from the specification variable value domain list to form pairwise keys. The pairwise keys are then compared character by character using the allowed combination list and written to the queue. Matching with OK or BAD flags, the correspondence between the manufacturer's value and the drug name value is checked. The check process involves retrieving candidate manufacturer values from the manufacturer variable value range list and candidate drug name values from the drug name variable value range list to form corresponding keys. Each key is then compared character-by-character in the correspondence table and written to the matching flag OK or BAD. Candidate values that do not meet the correspondence requirements are deleted using a field value deletion method. Candidate values marked BAD are written to a deletion queue and removed from the value range list, with a DEL flag written. Simultaneously, the trigger field identifier and source identifier are recorded. The recording process uses a trigger source write method, writing the field identifier of the deleted candidate value to the trigger field column, the candidate value source identifier to the source column, the arc identifier to the constraint arc column, the deletion sequence number to the sequence number column, and the deletion timestamp to the time column, resulting in a constraint removal record set.
[0085] Based on the constraint-removed record set, a backtracking fixed-switch method is used to perform item-by-item fixed and backtracking switching operations on fields that still retain multiple candidate values. The process involves reading the current value range list by field identifier, selecting the first candidate value, writing it into the fixed value column, and marking it with a FIX tag. If subsequent verification fails, a backtracking switching operation is performed. This backtracking operation undoes the writing to the fixed value column, marks it with an UNDO tag, moves the candidate pointer to the next candidate value, and marks it with a FIX tag. This process of pairing and verifying between fields is repeated. The verification process uses a pairwise comparison method: for each dosage form fixed value and specification value range, pairwise keys are formed and a character-by-character comparison of the allowed combination list is performed; for each manufacturer fixed value and drug name value range, corresponding keys are formed and a corresponding relationship table is executed. The process involves comparing character pairs and writing a deletion sequence number, field identifier, source identifier, and constraint identifier for each deletion operation. It aggregates the field identifiers, source identifiers, and associated constraint identifiers that caused consecutive deletions of candidate values. The aggregation process uses a consecutive deletion segment statistics method, scanning the deletion sequence numbers under the same field identifier in ascending order and writing consecutive deletion markers for records with three consecutive deletions. This information is then written into the attribution structure. The writing process uses an attribution record writing method, writing the field identifier into the attribution field column, the source identifier into the attribution source column, the associated constraint identifier into the attribution constraint column, the consecutive deletion count into the count column, the fixed value sequence into the fixed sequence column, and the fallback sequence into the fallback sequence column, generating a conflict constraint attribution set.
[0086] The AC-3 algorithm first initializes the arc queue to be checked. Each arc in the arc queue consists of a field pair identifier and a corresponding constraint identifier. The field pair includes dosage form and specification, manufacturer and drug name. An arc is taken out from the arc queue in sequence. The candidate value set of the previous field is traversed. For each candidate value, at least one value that satisfies the allowed correspondence mapping table is found in the candidate value set of the next field. If no value that satisfies the relationship is found, the candidate value is deleted from the candidate set of the previous field, and the field identifier and source identifier corresponding to the deleted candidate value are recorded. When a deletion operation occurs, all the remaining arcs that are the next field are added back to the arc queue to trigger a chain check. The above process is repeated until the arc queue is empty and the candidate value set of any field is deleted to be empty. All deleted records and the triggered constraint relationships are summarized to form a constraint removal record set.
[0087] The AC-3 algorithm, according to the formula:
[0088]
[0089] in: Indicates the candidate value The weighted support count was used as the result of the AC-3 constraint deletion criterion. This indicates a candidate value for the field currently being checked. This indicates a supporting candidate value in the candidate field of the counterparty. This represents the set of candidate values for the peer field that has a constraint relationship with the current field. This indicates an indicator function that takes the value 1 when the condition within the parentheses is true and 0 when the condition is false. Indicates the candidate value With candidate values Satisfy the given binary constraint relationship. This represents a set of binary constraints between field values and is used to describe pairwise or correspondence relationships. This represents the constraint hit basis weights and is used to provide basic support contributions. This represents the source co-weight and is used to adjust the proportion of the impact of source consistency on support. This represents the quality weight of candidate values and is used to adjust the proportion of the influence of candidate value normality on support. This represents the priority weight of candidate values and is used to adjust the proportion of the influence of candidate value ranking advantage on support. Indicates the candidate value Corresponding source identifier, Indicates the candidate value Corresponding source identifier, This represents the source coherence coefficient and is used to quantify the degree of consistency between the sources of two candidate values. Indicates the candidate value The quality coefficient is used to quantify its format regularity and consistency. Indicates the candidate value The priority coefficient is used to quantify its importance within the candidate domain;
[0090] Execution process: First, select candidate values to be checked from the current field's candidate domains. And determine its corresponding source identifier. Next, determine the candidate fields of the counterpart field that have constraints with the current field. And iterate through each of the candidate values one by one. and read synchronously Source identification Then for each pair Perform binary constraint relationship determination and pass the indicator function Combinations that satisfy the constraints are mapped to valid computational terms, while combinations that do not satisfy the constraints are mapped to zero-contribution terms. Then, the basic support terms are computed for combinations that satisfy the constraints. And calculate source collaboration items The consistency contribution of candidate value sources is quantified, and the quality term of candidate values is calculated simultaneously. To reflect the normative impact of candidate values and to calculate the priority term of candidate values. To reflect the ranking advantage of candidate values in the candidate domain, the weighted contributions of the above items are summed to form a single support contribution value, which is then multiplied by the result of the indicator function to obtain the support contribution value for the current candidate value. Effective support for incremental changes, subsequently, for The candidate values are obtained by performing a summation operation on the effective support increments corresponding to all candidate values. Weighted support count Finally, It serves as the basis for determining the consistency of AC-3 constraints and is used for subsequent decisions on retaining or deleting candidate values, thereby driving the generation of the constraint elimination record set.
[0091] A drug data consistency verification system is provided, which is used to execute the above-mentioned drug data consistency verification method. The system includes:
[0092] Rule Index Module: Based on drug rule entries, it reads approval number, drug name, dosage form, specification, manufacturer, and version identifier, splits field constraint content, aggregates the same field validation items, completes the binding mapping between rule identifiers and constraint units, and generates a rule constraint index set;
[0093] Decision network module: Based on the rule constraint index set, it performs equality and inequality checks on the drug field, verifies the combination of dosage form and specification one by one, constructs the drug key connection order, completes the arrangement and binding of the relationship between the decision items, and establishes the constraint decision network;
[0094] Conflict Trigger Module: Based on the constraint decision network, write the change record of the drug field, clear the old value of the corresponding field and replace it with the new value, trigger the field decision item by item, filter the records with consistent drug keys, pass the decision flag along the connection order, record the complete trigger path and merge duplicate conflicts, and generate a set of rule conflict paths;
[0095] The difference location module: Based on the rule conflict path set, it locks the record set corresponding to the approval number, splices the core fields of the drug in a fixed order, fills in the missing field placeholder values, compares the results of field combination from multiple sources layer by layer, drills down the difference branches and marks the field positions to obtain the field difference location set;
[0096] Constraint Attribution Module: Based on the field difference location set and rule conflict path set, it filters candidate values for drug fields, verifies the pairing relationship between dosage form and specification, checks the associated values of manufacturers, performs candidate value elimination and rollback switching, collects the sources of trigger constraints, and generates a conflict constraint attribution set.
[0097] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for verifying the consistency of drug data, characterized in that, Includes the following steps: S1: Based on drug rule entries, read the approval number, drug name, dosage form, specification, manufacturer, and version identifier, split the field constraint content, collect the same field validation items, complete the binding mapping between rule identifier and constraint unit, and generate a rule constraint index set; S2: Based on the rule constraint index set, perform equivalence and inequality checks on the drug field, verify each combination of dosage form and specification, construct the drug key connection order, complete the arrangement and binding of the relationship between the judgment items, and establish a constraint judgment network. S3: Based on the constraint determination network, write the drug field change record, clear the old value of the corresponding field and replace it with the new value, trigger the field determination item by item, filter the records with consistent drug keys, pass the determination flag along the connection order, record the complete trigger path and merge duplicate conflicts, and generate a set of rule conflict paths. S4: Based on the set of conflicting rules, lock the set of records corresponding to the approval number, splice the core fields of the drug in a fixed order, fill in the missing field placeholders, compare the results of multi-source field combinations layer by layer, drill down the difference branches and mark the field positions to obtain the field difference location set; S5: Based on the field difference location set and rule conflict path set, filter candidate values for drug fields, check the matching relationship between dosage form and specification, verify the associated values of manufacturers, perform candidate value elimination and rollback switching, collect the sources of trigger constraints, and generate a conflict constraint attribution set.
2. The drug data consistency verification method according to claim 1, characterized in that, The rule constraint index set includes rule identifier, field identifier, constraint type identifier, field combination identifier, and source limitation identifier. The constraint determination network includes field determination node identifier, field connection node identifier, node sequence identifier, and drug key association identifier. The rule conflict path set includes rule identifier, drug key identifier, trigger field identifier set, source identifier set, and determination node sequence identifier. The field difference location set includes field identifier, difference source identifier set, and field sequence position identifier. The conflict constraint attribution set includes constraint identifier, conflict field identifier, candidate value source identifier, and conflict type identifier.
3. The drug data consistency verification method according to claim 1, characterized in that, The specific steps for generating the rule constraint index set are as follows: Based on drug rule entries, the approval number, drug name, dosage form, specification, manufacturer, and version identifier are read. For each rule entry, the field constraint content is broken down item by item according to the field identifier. Field equality restrictions, field inequality restrictions, and field combination restrictions are classified and stored according to the field identifier. Constraint items under the same field identifier are merged and recorded to obtain a set of field constraint units. Based on the set of field constraint units, each field constraint unit and its corresponding rule identifier are written into the binding structure one by one. A sequential index is established for the field constraint units under the same rule identifier and a rule-level reference relationship is formed. The mapping relationship between the rule identifier and the field constraint unit is stored in a fixed manner to generate a rule constraint index set.
4. The drug data consistency verification method according to claim 1, characterized in that, The specific steps for generating the constraint decision network are as follows: Based on the rule constraint index set, extract the field constraint units under the rule identifier, perform equivalence and inequality judgment on the drug field values, compare the dosage form value and specification value with the allowed combination list in a pairwise manner, record the judgment results in the field order and generate a field judgment result sequence to obtain the field judgment sequence set. Based on the field determination sequence set, the field determination results are grouped according to the drug key identifier. The determination results under the same drug key are connected and arranged according to the rule constraint order, the dependencies are written and the transmission order is fixed. All rule-corresponding connection structures are summarized to establish a constraint determination network.
5. The drug data consistency verification method according to claim 1, characterized in that, The specific steps for generating the rule conflict path set are as follows: Based on the constraint determination network, the system receives drug field change records, locates the corresponding drug key identifier and field identifier, performs a deletion operation on existing field values and writes new field values, establishes a correspondence between the changed fields and their associated determination nodes, forms a field input set for subsequent determination, and generates a field determination input set. Based on the field judgment input set, the Rete algorithm is used to match the field input under the same drug key item by item according to the judgment node order, filter out records with inconsistent drug keys, convert the matching result into a judgment mark and pass it along the node connection order. During the transmission process, the combination of field identifier and node identifier is continuously recorded to obtain the judgment transmission path set. Based on the set of determination transmission paths, the rule identifier, drug key identifier, and trigger field identifier are extracted from the records that reach the complete path. The same rule identifier and drug key combination are merged repeatedly. The complete nodes are written sequentially into the conflict record structure to generate a set of rule conflict paths.
6. The drug data consistency verification method according to claim 5, characterized in that, The Rete algorithm is used to distribute the field judgment input set to the condition node cache area according to the field identifier. For each field input, equality judgment and inequality judgment are performed to generate a hit token. The token is written to the left and right cache areas of the connection node according to the drug key identifier. Connection matching is performed on the left and right cache areas of the same connection node according to the drug key identifier. When the connection is successful, the field binding is merged and a new token is generated. The new token continues to be written to the cache area of the subsequent connection node according to the connection order and the connection matching is repeated. The rule identifier, trigger field identifier set, and node passage sequence of the token arriving at the terminal node are written into the judgment transmission path set.
7. The drug data consistency verification method according to claim 1, characterized in that, The specific steps for generating the field difference location set are as follows: Based on the set of conflicting rules, the approval numbers in the conflicting records are filtered and the corresponding multi-source record set is locked. For each approval number, the approval number, drug name, dosage form, specification, manufacturer, and version identifier are extracted. The field values are arranged in the order of the preset fields. Fixed placeholder values are written for missing fields. Each record is converted into a combination structure with consistent field order, and a set of field order combinations is generated. Based on the field order combination set, the multi-source combination structure under the same approval number is compared item by item according to the field order. The position where the field value first appears inconsistent is identified. For inconsistent fields, segmented comparison is performed to confirm the range of difference. The field identifier and source identifier corresponding to the inconsistent field are written into the positioning structure to obtain the field difference positioning set.
8. The method for verifying the consistency of drug data according to claim 1, characterized in that, The specific steps for generating the conflict constraint attribution set are as follows: Based on the field difference location set and the rule conflict path set, the field identifiers involved in the conflict are extracted, the values of multiple source fields are locked, the field values are written into the candidate set according to the field identifier, and the source identifier and the number of occurrences are recorded for each candidate value, forming a set of field values for constraint verification, and thus obtaining the field candidate value set. Based on the candidate value set of the field, the AC-3 algorithm is used to check the dosage form value and specification value in pairs, and to check the correspondence between the manufacturer value and the drug name value. Candidate values that cannot meet the correspondence are deleted, and the trigger field identifier and source identifier are recorded simultaneously to obtain the constraint elimination record set. Based on the constraint elimination record set, for fields that still retain multiple candidate values, perform a step-by-step fixing and rollback switching operation, repeatedly perform field pairing and verification, collect the field identifiers, source identifiers and associated constraint identifiers that cause candidate values to be continuously deleted, write the above information into the attribution structure, and generate a conflict constraint attribution set.
9. The drug data consistency verification method according to claim 8, characterized in that, The AC-3 algorithm first initializes the arc queue to be checked. Each arc in the arc queue consists of a field pair identifier and a corresponding constraint identifier. The field pair includes dosage form and specification, manufacturer and drug name. An arc is taken out from the arc queue in sequence. The candidate value set of the previous field is traversed. For each candidate value, at least one value that satisfies the allowed correspondence mapping table is searched in the candidate value set of the next field. If no value that satisfies the relationship is found, the candidate value is deleted from the candidate set of the previous field, and the field identifier and source identifier corresponding to the deleted candidate value are recorded. When a deletion operation occurs, all the remaining arcs that are the next field are added back to the arc queue to trigger a chain check. The above process is repeated until the arc queue is empty and the candidate value set of any field is deleted to be empty. All deleted records and the triggered constraint relationships are summarized to form a constraint removal record set.
10. A drug data consistency verification system, characterized in that, The drug data consistency verification method according to any one of claims 1-9, wherein the system comprises: Rule Index Module: Based on drug rule entries, it reads approval number, drug name, dosage form, specification, manufacturer, and version identifier, splits field constraint content, aggregates the same field validation items, completes the binding mapping between rule identifiers and constraint units, and generates a rule constraint index set; Decision network module: Based on the rule constraint index set, it performs equivalence and inequality checks on the drug field, verifies each combination of dosage form and specification, constructs the drug key connection order, completes the arrangement and binding of the relationship between the decision items, and establishes the constraint decision network; Conflict triggering module: Based on the constraint determination network, write the drug field change record, clear the old value of the corresponding field and replace it with the new value, trigger the field determination item by item, filter the records with consistent drug keys, pass the determination mark along the connection order, record the complete triggering path and merge duplicate conflicts, and generate a set of rule conflict paths; The difference location module: Based on the set of conflicting rules, it locks the set of records corresponding to the approval number, splices the core fields of the drug in a fixed order, fills in the missing field placeholders, compares the results of field combinations from multiple sources layer by layer, drills down the difference branches and marks the field positions to obtain the field difference location set; Constraint Attribution Module: Based on the field difference location set and rule conflict path set, it filters candidate values for drug fields, verifies the pairing relationship between dosage form and specification, checks the associated values of manufacturers, performs candidate value elimination and rollback switching, collects the sources of trigger constraints, and generates a conflict constraint attribution set.