A drug inventory early warning system
By using the inventory status verification module and batch expiration date analysis of the drug inventory early warning system, the problem of insufficient capture of drug inventory change trends in existing technologies has been solved, enabling dynamic comparison and hierarchical management of drug inventory, and improving the pertinence and practicality of the early warning.
Patent Information
- Application Number
- CN202610155629.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-04
- Publication Date
- 2026-04-21
- Estimated Expiration
- 2046-02-04
AI Technical Summary
The existing drug inventory early warning system cannot effectively capture inventory change trends, resulting in the failure to identify drug backlogs, shortages, and expired drugs in a timely manner, and the early warning response is not targeted.
The inventory status verification module verifies drug batch information, combines batch expiration dates and multi-hospital inventory data to analyze inventory change trends, identify anomalies and generate early warning signals, and realizes dynamic comparison and hierarchical management of inventory anomalies.
It achieves multi-dimensional integration and trend correlation of drug inventory, dynamically compares inventory changes, accurately locates inventory anomalies and simultaneously transmits risk warnings, thus improving the pertinence and practicality of inventory management.
Smart Images

Figure CN121639105B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of inventory management technology, and in particular to a pharmaceutical inventory early warning system. Background Technology
[0002] Inventory management involves the effective control and management of information such as the quantity, status, and flow of materials, products, or resources in all stages of procurement, storage, distribution, and use. It aims to improve material turnover efficiency, reduce inventory costs, avoid stockpiling and shortages, and ensure the continuity and stability of the supply chain. It is widely used in industries such as manufacturing, retail, healthcare, and logistics. Among these, a traditional pharmaceutical inventory early warning system is an information management system used to monitor the inventory status of various medicines in medical institutions or the pharmaceutical supply chain and issue early warnings when target quantity standards are reached.
[0003] The existing system uses a single inventory standard for management, which ignores the dynamic correlation of drug batch flow between hospitals. The batch expiration information lacks linkage with the actual inventory status. The inventory consumption trend is only statically monitored through scattered data nodes, which cannot effectively capture the trend of inventory changes. Inconsistencies are likely to occur in data from different sources. It is not easy to identify batch retention and consumption anomalies. In actual operation, there are frequent problems of backlog, shortage and expired drugs not being identified in time, resulting in the lack of targeted early warning response. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a drug inventory early warning system.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a drug inventory early warning system, the system comprising:
[0006] The inventory status verification module is based on the hospital pharmacy inventory records. It compares the relationship between drug number and batch number, verifies the batch information of incoming goods, filters the quantity according to the expiration date, and compares the consistency of the source to obtain inventory status data for multiple hospital areas.
[0007] Based on the multi-hospital area inventory status data, the inventory change direction determination module determines the continuous changes in drug inventory, analyzes the direction of increase and decrease, compares the continuity of changes in the same direction, identifies records with consistent changes, updates the status flag, and obtains an abnormal inventory fluctuation identifier.
[0008] Based on the abnormal inventory fluctuation identifier, the batch stability correlation module analyzes the batch expiration date and inventory records, filters multiple period changes of the same batch, compares the matching status of the expiration date and the direction of change, judges the stability deviation, and obtains the batch dissipation correlation risk characterization.
[0009] Based on the batch dissipation-related risk characterization, the inventory risk classification module compares the corresponding relationships of hospital areas, analyzes the deviations between inventory anomalies and stability, determines the record belonging interval, adjusts the mapping relationship and classifies the data, and obtains the inventory anomaly status sequence.
[0010] The inventory early warning generation module analyzes the risk batch records based on the inventory anomaly status sequence, determines the distribution location of the risk batch records, identifies the registration status and stability risk, integrates the anomaly association information, and obtains the inventory early warning signal push result.
[0011] The present invention improves upon this invention by including the following: the multi-hospital area inventory status data includes unique drug identifiers, batch allocation information, and hospital area distribution; the inventory fluctuation anomaly identifier includes consumption trend type, change continuity indicator, and anomaly status code; the batch dissipation associated risk characterization includes dissipation rate characteristics, batch retention attributes, and risk identification number; the inventory anomaly status sequence includes graded interval numbers, an abnormal drug batch list, and risk category information; and the inventory early warning signal push result includes the early warning target hospital area, early warning batch code, and risk response prompt.
[0012] The present invention is improved in that the inventory status verification module includes:
[0013] The data mapping and extraction submodule analyzes each drug number and batch number based on the pharmacy inventory records in the hospital area. By comparing batch information in groups, it calculates the order of entry time for each batch under the same drug number, judges the completeness of the mapping relationship between data, and obtains the drug batch mapping sequence.
[0014] The expiration date screening calculation submodule filters the remaining expiration date and inventory quantity of each batch based on the drug batch mapping sequence, determines whether the batch meets the expiration date requirements, compares the synchronicity between the inventory quantity and remaining expiration date of the batches, removes drug batches that do not meet the conditions, and obtains the expiration date applicable inventory information.
[0015] The consistency verification and correction submodule analyzes the relevant drug batches based on the expiration date applicable inventory information, compares the source of each data with the upload process, determines whether the data content is consistent, adjusts inconsistent items from different sources, and unifies them into a structured data format to obtain multi-hospital area inventory status data.
[0016] The present invention is improved in that the inventory change determination module includes:
[0017] The inventory trend calculation submodule analyzes the inventory quantity of each drug number in a continuous time period based on the inventory status data of the multi-hospital area, calculates the inventory change between any two consecutive time nodes, determines whether the inventory of each drug number increases or decreases in each time period, and obtains the sequence of drug inventory change direction.
[0018] The change continuity judgment submodule compares the inventory change direction of adjacent time periods based on the sequence of changes in drug inventory, filters out drug records whose inventory change direction remains consistent over multiple consecutive time periods, marks the records with continuous feature tags, and obtains a set of inventory change continuity tags.
[0019] The status tag update submodule adjusts the corresponding hospital records based on the inventory change persistence tag set, updates the inventory status tag field, and collects drug number data with continuous change characteristics to obtain an inventory fluctuation anomaly identifier.
[0020] The present invention is improved in that the batch stable association module includes:
[0021] The expiration date matching and verification submodule analyzes the associated drug number and batch number based on the inventory fluctuation anomaly identifier, determines the relationship between the direction of change of remaining expiration date and the direction of increase or decrease of inventory within a continuous period, compares the same or opposite states within each period, identifies the same and opposite period situations, and obtains the direction matching offset sequence.
[0022] Based on the direction matching offset sequence, the cycle inventory tracking submodule calculates the start and end quantities of the inventory of the batch in each cycle, analyzes the proportional trend of inventory quantity changes in continuous cycles, determines the continuity or change status of the inventory change direction during the cycle, organizes the time sequence data, and obtains the cycle inventory fluctuation trajectory vector.
[0023] The deviation risk assessment submodule calculates the relative change between inventory quantity and remaining shelf life in each period based on the cycle inventory fluctuation trajectory vector, analyzes the difference between the two types of relative changes, and uses the following formula:
[0024] ;
[0025] By obtaining the stability deviation from the mean, determining the deviation risk status, and obtaining a batch dissipation-related risk characterization, among which... Indicates the first The batch stability deviates from the mean. This indicates the total number of analysis periods. The periodic numbers, from 1 to , This indicates the batch number of the drug. Indicates the first Cycle number Changes in batch inventory quantity Indicates the first The start time of the period Batch inventory quantity, Indicates the first Cycle number Changes in the remaining shelf life of the batch. Indicates the first The start time of the period The remaining shelf life of the batch.
[0026] The present invention is improved in that the inventory risk classification module includes:
[0027] The anomaly attribution judgment submodule, based on the batch dissipation association risk characterization, compares the consumption trend type with the change continuity indicator to determine whether the quantity changes of the same drug in the inventory records of different hospital areas are synchronized, classifies them according to the risk level range, and obtains the anomaly attribution mapping result.
[0028] The classification mapping adjustment submodule analyzes the distribution information of hospital areas and the frequency of occurrence of abnormal records based on the abnormal attribution mapping results, compares the mapping relationship between each category, calculates the risk mapping offset, adjusts the classification rule mapping relationship, and obtains the risk classification update result.
[0029] Based on the risk classification update results, the state sequence generation submodule filters the associated hospital area inventory distribution codes and stability deviation markers, determines the state code combination of batch records, optimizes the temporal arrangement of each data, analyzes the classification interval number of each record, and obtains the inventory abnormal state sequence.
[0030] The present invention is improved in that the inventory early warning generation module includes:
[0031] The risk classification record filtering submodule analyzes the risk classification number of each batch based on the inventory anomaly status sequence, determines whether each number belongs to the warning level range, compares the mapping between risk level and drug number, and obtains the drug batch index set.
[0032] The status risk identification submodule, based on the drug batch index set, retrieves the physical storage location and current inventory status of each batch in the hospital's inventory registration, analyzes the risk marking content of each batch, determines whether there is a feature correlation between the risk marking and the inventory status, and obtains the inventory risk status identifier.
[0033] The abnormal information integration submodule, based on the inventory risk status identifier, extracts the associated risk level, consumption trend and distribution data according to the drug number, batch code and hospital location, integrates them into unified warning information, and counts the batch records marked as abnormal, thus obtaining the inventory warning signal push result.
[0034] The present invention is improved in that the batch information refers to the production batch number, warehousing batch and expiration date batch of the drug, and the source consistency refers to the degree of consistency and matching of the data content of the same drug or batch between different data sources.
[0035] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0036] In this invention, by realizing multi-dimensional integration of inventory data and linkage with batch status, and by dynamically comparing inventory change trends, a correlation judgment between batch expiration date and consumption pattern is established. The circulation characteristics of drugs in multiple hospital areas and time periods are comprehensively analyzed, and risk characteristics are classified in a structured data sequence manner. Based on the dynamic correlation of trends and stability, early warning results are output, so that inventory anomalies can be accurately located through trend indication and hierarchical characteristics, and risk warnings are transmitted simultaneously, thus achieving targeted and practical inventory early warning. Attached Figure Description
[0037] Figure 1 This is a system flowchart of the present invention;
[0038] Figure 2 This is a flowchart of the inventory status verification module in this invention;
[0039] Figure 3 This is a flowchart of the inventory change determination module in this invention;
[0040] Figure 4 This is a flowchart of the batch stable association module in this invention;
[0041] Figure 5 This is a flowchart of the inventory risk classification module in this invention;
[0042] Figure 6 This is a flowchart of the inventory early warning generation module in this 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] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0045] All user-related information involved in this invention (including but not limited to biometric information, identity verification information, behavioral data, device information, and other data that can be used for identity verification and personalized services) is collected and processed with the user's full knowledge and voluntary consent. The use of data is limited to purposes necessary for providing the technical services of this invention, and reasonable technical and management measures will be taken to ensure the security and confidentiality of users' personal information in terms of information protection and privacy.
[0046] Example: Please refer to Figure 1 The present invention provides a technical solution: a drug inventory early warning system comprising:
[0047] The inventory status verification module is based on the pharmacy inventory records in the hospital area. By comparing the data relationship between the drug number and the batch number, it verifies the batch information corresponding to each entry time, filters the inventory quantity by comparing the remaining shelf life days, compares the consistency of various data sources, adjusts the data upload process and fills in the missing items, and obtains multi-hospital area inventory status data.
[0048] The inventory change direction determination module is based on inventory status data from multiple hospital areas. It determines the inventory changes of the same drug number in a continuous time period, analyzes the increase or decrease direction of inventory records in the time sequence, compares whether the changes in adjacent time periods continue in the same direction, identifies drug records with a continuously consistent change direction, and updates the drug inventory status marker of the corresponding hospital area to obtain an abnormal inventory fluctuation marker.
[0049] The batch stability correlation module analyzes the remaining expiration information and current inventory records of each drug batch based on the abnormal inventory fluctuation identifier, filters the inventory changes of the same batch in multiple periods, compares the matching status between the remaining expiration records and the direction of inventory changes, judges the characteristics of batch stability deviation, and obtains the batch dissipation correlation risk characterization.
[0050] The inventory risk classification module is based on batch dissipation associated risk characterization, compares the corresponding relationship under the dimensions of each hospital area, analyzes whether the same drug simultaneously shows abnormal inventory changes and batch stability deviations, determines the belonging interval of the associated record in the classification rules, adjusts the classification mapping relationship, performs status classification, and obtains the inventory abnormal status sequence.
[0051] The inventory early warning generation module analyzes drug batch records in the high-level range based on the inventory anomaly status sequence, determines the position of the drug batch record in the hospital's inventory distribution, identifies the corresponding batch's inventory registration status and stability risk marker, and integrates anomaly correlation information to obtain the inventory early warning signal push result.
[0052] Multi-campus inventory status data includes unique drug identifiers, batch allocation information, and campus distribution. Inventory fluctuation anomaly indicators include consumption trend type, change continuity indicator, and anomaly status code. Batch dissipation associated risk characterization includes dissipation rate characteristics, batch retention attributes, and risk identification number. Inventory anomaly status sequence includes graded interval number, abnormal drug batch list, and risk category information. Inventory early warning signal push results include early warning target campus, early warning batch code, and risk response prompt.
[0053] In the inventory status verification module, the drug number refers to the unique identifier assigned to each drug in the hospital's inventory management system, used to distinguish different drug types; the data relationship refers to the association and mapping relationship between data such as drug number, batch number, warehousing time, inventory quantity, and remaining expiration date, used for traceability and status comparison; the batch information refers to the drug's production batch number, warehousing batch, and expiration date batch, recording the drug's specific source and batch characteristics; source consistency refers to the degree of consistency in the data content of the same drug or batch between different data sources (such as manual entry, automatic collection, logistics systems, etc.); the upload process refers to the entire process by which each hospital pharmacy uploads local inventory, batch, and other data to the central system according to the prescribed steps and standard format; and filling in missing items refers to supplementing and improving information when necessary fields (such as expiration date, batch, etc.) are found to be missing during the data collection and upload process to ensure data integrity.
[0054] In the inventory change direction determination module, inventory change refers to the characteristics of the inventory quantity of the same drug within a continuous time period (such as daily, shift, or weekly) (increase, decrease, or no change); the direction of increase or decrease in inventory records refers to whether the inventory quantity recorded each time has increased or decreased compared to the previous point in time, with the direction being "increase" or "decrease"; continuous same direction means that the inventory quantity continues to change in the same direction (e.g., continuous decrease or continuous increase) in multiple consecutive records; consistent change direction means that if the inventory of a certain drug continuously decreases (or continuously increases) in multiple time periods, its direction is considered to be consistent; drug inventory status label refers to labeling each drug inventory record with a status tag, such as "normal consumption", "abnormal consumption", "static", etc., for subsequent analysis.
[0055] In the batch stability correlation module, the direction of inventory change refers to the trend of the inventory quantity change of a certain batch of medicine within a continuous period of time (continuous decrease, fluctuation or increase); the matching status refers to the correspondence between the remaining expiration date and the direction of inventory change, such as "mismatch" if the expiration date is short but the inventory is consumed slowly; the characteristics of stability deviation refer to the specific phenomena that occur when there is an abnormal difference between the actual inventory consumption trend of a batch of medicine and the expected consumption pattern (such as normal delivery, natural loss, etc.), such as backlog, about to expire but not delivered, etc.
[0056] In the inventory risk classification module, the "hospital area" dimension refers to using different hospitals (or hospital areas) as the objects of analysis and comparison, with the hospital area being the analysis dimension; the "correspondence relationship" refers to the data comparison, mapping, and cross-relationship of the same drug in different hospital areas, different batches, and different states; "abnormal inventory changes" refers to abnormal fluctuations in the consumption and replenishment of a drug compared to historical or regular trends; "batch stability deviation" refers to abnormal consumption and remaining shelf life of drug batches, showing significant differences from similar drugs or standard patterns; "classification rules" refers to a rule system that classifies drugs or batches into different risk levels according to preset standards; and "classification mapping relationship" refers to the process of mapping the actual collected and analyzed data to the above risk classifications to determine which level it belongs to.
[0057] In the inventory warning generation module, the high-level range refers to the batches and status ranges that are judged to be high-risk or require special attention; the location in the hospital inventory distribution refers to the distribution of high-risk drug batches in various hospitals, pharmacies, and other physical locations; the inventory registration status refers to the real-time inventory data status of drugs registered in the system, such as the current quantity and whether it is in normal consumption; the stability risk label refers to the risk label assigned by the system to drug batches based on their stability assessment, such as "low risk," "warning," and "urgent"; and the abnormal association information refers to the integrated result of multi-dimensional information such as batch number, hospital number, risk level, and consumption trend associated with drugs that have been identified as abnormal, which is used for the final warning output.
[0058] Please see Figure 2 The inventory status verification module includes:
[0059] The data mapping and extraction submodule analyzes each drug number and batch number based on the pharmacy inventory records in the hospital area. By comparing batch information in groups, it calculates the order of entry time for each batch under the same drug number, judges the completeness of the mapping relationship between data, and obtains the drug batch mapping sequence.
[0060] Extract each drug number from the records and verify its uniqueness. For example, extract the drug record with the number "D001" to ensure it appears only once in the system, avoiding duplicate numbers. Then extract the corresponding batch numbers such as "B101", "B102", "B103", etc., and establish an initial association group between the number and the batch. Group all batches under the same drug number and categorize them. Retrieve the registered entry time through the batch number and convert it to a standard date format such as "January 10, 2023". The data is then sorted in ascending order, and the reasonableness of the chronological order is judged. For example, if the registration date of "B101" is "January 10, 2023", "B102" is "January 25, 2023", and "B103" is "February 5, 2023", their entry order is consistent and considered normal. If "B102" is found to be "January 5, 2023" earlier than "B101", it is judged as an abnormal order. Then, the time interval between adjacent batches is calculated sequentially. For example, the time interval between "B101" and "B102" is calculated sequentially. The interval between "B102" and "B103" is 11 days. If the time interval is negative or 0 days, it is recorded as a conflicting batch. At the same time, it is determined whether there are two batches registered at the same time. If both batches "B101" and "B104" are found to be "January 10, 2023", the data source analysis process is entered. The entry source is cross-compared. For example, if the manual entry time is "January 10, 2023" and the automatic upload time is "January 13, 2023", the time difference is judged to be 3 days. The upper limit of the upload time difference is set to 5 days. This situation is still within the allowable range. If it exceeds 5 days, it is marked as a source conflict. Then, the completeness is compared according to the number of batches that should appear under the drug number. For example, if there should be 5 batches registered, but only 3 valid batches are extracted, the completeness is 60%. If the completeness is lower than the set benchmark value of 70%, it is recorded as a missing batch registration. The verification structure of all drug numbers and their batches in the time sequence relationship is extracted as a drug batch mapping sequence.
[0061] The expiration date screening calculation submodule is based on the drug batch mapping sequence. It filters the remaining expiration date and inventory quantity of each batch, determines whether the batch meets the expiration date requirements, compares the synchronicity of inventory quantity and remaining expiration date between batches, removes drug batches that do not meet the conditions, and obtains the expiration date applicable inventory information.
[0062] Extract the remaining shelf life days and current inventory quantity for each batch. Calculate the remaining shelf life days for each batch based on the current date. For example, if the current date is January 1, 2026, and the expiration date for batch "B101" is February 15, 2026, then the remaining shelf life is 45 days. Calculate the remaining shelf life for all batches in this way to determine if the minimum shelf life requirement is met. For example, if the minimum remaining shelf life is set to 30 days, all batch records with less than 30 days remaining are removed. Then, compare the inventory quantity with the remaining shelf life for the remaining batches. For example, batch "B101" has an inventory quantity of 800 units and a remaining shelf life of 45 days; batch "B102" has an inventory quantity of 500 units and a remaining shelf life of 40 days; batch "B103" has an inventory quantity of 1200 units and a remaining shelf life of 70 days. The inventory difference and expiration date difference between any two batches are calculated sequentially. Then, it is determined whether there is a significant difference. If the inventory difference exceeds 300 units and the expiration date difference is only 5 days, it indicates that the consumption and expiration date are not synchronized. The threshold for the ratio of inventory to expiration date difference is set to 10, that is, for every 100 units increase or decrease in inventory, the expiration date change should reach more than 10 days. If this ratio is not reached, the inventory change and expiration date of the batch are considered to be not synchronized. For example, if the inventory difference between batches "B102" and "B103" is 700 units and the expiration date difference is 30 days, the ratio is 700 divided by 30, which is approximately 23, much greater than the threshold of 10. Therefore, it is judged to be not synchronized and is removed. After the above screening, qualified batches with a synchronized trend of inventory quantity and remaining expiration date and an expiration date greater than 30 days are obtained as applicable inventory information for the expiration date.
[0063] The consistency verification and correction submodule analyzes the relevant drug batches based on the expiration date and applicable inventory information, compares the source of each data with the upload process, determines whether the data content is consistent, adjusts inconsistent items from the source and fills in missing fields, and unifies them into a structured data format to obtain multi-hospital area inventory status data.
[0064] After obtaining the applicable inventory information for the expiration date, each record is categorized by data source, for example, marked as manual entry, automatic upload, or logistics synchronization. It is then grouped by drug number and batch number. Within each group, the entry time, inventory quantity, and remaining expiration date fields for the same batch are compared and verified. Tolerance ranges for the differences in these three fields are set: entry time difference must not exceed 2 days, inventory quantity difference must not exceed 3% of the total, and remaining expiration date difference must not exceed 1 day. For example, if batch "B103" is registered as 1000 units in automatic upload but 960 units in manual entry, the difference is 40 units, accounting for 4%, exceeding the 3% threshold. This is considered an inconsistent record and requires correction. Simultaneously, according to priority rules, the data source priority is set to: automatic upload highest. The next step is logistics data collection, with manual entry being the least common method. The primary method is automatic data upload, which overwrites and corrects the remaining data. If a field is missing from a particular source, data from other sources within the same batch is retrieved to fill it in. For example, if a manually entered record lacks remaining expiration information, but the logistics data collection record shows the batch's expiration date as "June 30, 2026," then that value is directly filled into the missing field to ensure data integrity. If multiple sources are missing a field during the data filling process, it is marked as uncorrectable and removed from the structured processing flow. After all fields are checked, filled in, and optimized, the data is reorganized into a structured data format according to a unified field order, including drug number, batch number, warehousing time, inventory quantity, remaining expiration date, data source, and verification status. The output is standardized inventory status data across multiple hospital campuses.
[0065] Please see Figure 3 The inventory change prediction module includes:
[0066] The inventory trend calculation submodule analyzes the inventory quantity of each drug number in a continuous time period based on the inventory status data of multiple hospital areas, calculates the inventory change between any two consecutive time nodes, determines whether the inventory of each drug number increases or decreases in each time period, and obtains the sequence of drug inventory change direction.
[0067] Grouping by drug number as the primary key field, the inventory registration quantity for each drug number at each time point is extracted, with the unified time point being the daily inventory record. For example, the inventory records for drug number "D1001" from January 1st to January 5th, 2026 are: 1000 units, 950 units, 920 units, 910 units, and 900 units, corresponding to the 1st to the 5th respectively. Each record is arranged in ascending order by date to form a continuous time series. Then, the inventory difference between any two consecutive time points is calculated, that is, the inventory quantity at the later time point is subtracted from the inventory quantity at the previous time point to obtain the change value. For example, 950 on the 2nd day minus 1000 on the 1st day is -50, and 920 on the 3rd day minus 950 on the 2nd day is -30. This process is repeated to obtain the complete change sequence: -50, -30, -10. Then, for each change, determine the sign: if the change is less than 0, record it as a decrease; if it is equal to 0, record it as unchanged; if it is greater than 0, record it as an increase. Generate an inventory change direction sequence in sequence. In this example, the change direction is continuous decrease, marked as "decrease decrease decrease decrease". If the inventory of a certain drug number is 900, 930, 910, and 940 units in a certain period, the change is +30, -20, and +30 respectively, and the direction sequence is "increase decrease increase", which is recorded as fluctuation change. During the execution process, for records with a difference of more than 1 day between the registration time points of different periods, such as consecutive records of January 1st and January 3rd, a blank time point needs to be inserted and set as an uncomparable record. This type of data does not participate in the continuity analysis. The above operations generate the inventory change direction sequence of each drug number in each time period.
[0068] The change continuity judgment submodule compares the change direction of inventory in adjacent time periods based on the sequence of changes in drug inventory, filters out drug records whose change direction of inventory is consistent in multiple consecutive time periods, marks the records with continuous feature tags, and obtains a set of inventory change continuity tags.
[0069] The change direction within each record is compared pairwise to determine if the change direction is consistent across adjacent time periods. For example, a direction sequence of "increase-increase-increase" indicates three consecutive increases in inventory, thus marking it as a record with a consistent direction. A direction sequence of "increase-decrease-increase" indicates a change in direction, failing to meet the continuity requirement. A minimum consecutive consistent segment length is set to 3 times, meaning the direction must be the same for at least 3 consecutive time periods to be considered a continuous change. If less than 3 times, it is not marked. During execution, each data set is traversed using a sliding window method. Starting from the first position, each "increase-increase-decrease" in the "increase-increase-decrease" sequence is compared. If an inconsistency is found, the window is moved one position to compare again, continuing this process until the entire data set has been traversed. After identifying sequences that meet the criteria, the... Add a continuity marker to the time range of the drug number, such as "continuous decrease" or "continuous increase". For example, the inventory of drug number "D2001" in a certain hospital from January 1 to January 7 was 1200, 1180, 1150, 1120, 1100, 1070, and 1040 respectively, with differences of -20, -30, -30, -20, -30, and -30 respectively. The direction is "decreasing". The continuity length is 6, which meets the set requirements, so the "continuous decrease" label is assigned. If another number "D3002" changes in the direction of "increase, increase, decrease, increase, decrease, decrease" in the same time period, then the continuity consistency is not met, so no label is added. Extract all drug number records that meet the continuity direction consistency to obtain the inventory change continuity label set.
[0070] The status flag update submodule adjusts the drug number and corresponding hospital records based on the inventory change persistence tag set, updates the inventory status flag field, collects drug number data with continuous change characteristics, and obtains inventory fluctuation anomaly identifiers.
[0071] For each tagged drug number record, a location operation is performed in the original inventory status data. The corresponding hospital number, inventory change direction, and date range are extracted, and the inventory status marker field is updated to "abnormal decrease" or "abnormal increase," etc. If the original status field is "normal," it is overwritten with the current marker. If the original field already has an "abnormal" marker, the highest level marker is retained. In the data aggregation table, all updated drug numbers are combined with their corresponding hospital number, date range, and change direction for storage, forming a status aggregation table. For example... If drug code "D1001" is recorded as "continuously decreasing" in hospital area "R001" from January 1st to January 7th, then a record will be generated in the status aggregation: [D1001, R001, 2026-01-01 to 2026-01-07, abnormal decrease]. If the same drug code shows similar continuous markings in multiple hospital areas, then corresponding status records will be established and marked separately. In this way, a status update system is formed to map the direction of drug inventory changes to its hospital area. The drug data with all updated status fields will be output to form an abnormal inventory fluctuation indicator.
[0072] Please see Figure 4 The batch stable association module includes:
[0073] The expiration date matching and verification submodule analyzes the associated drug number and batch number based on the abnormal inventory fluctuation identifier, determines the relationship between the direction of change of remaining expiration date and the direction of increase or decrease of inventory within a continuous period, compares the same or opposite states within each period, identifies the same and opposite period situations, and obtains the direction matching offset sequence.
[0074] Extract the drug number and batch number fields associated with the anomaly identifier, and for each anomaly identifier record, retrieve its corresponding time period, inventory change direction, and remaining expiration date fields. Perform periodic processing, dividing each drug batch into continuous period sets according to standard periods such as daily, three-day, and weekly. For example, January 1st to January 14th, 2026, is divided into two periods: Period 1 is from the 1st to the 7th, and Period 2 is from the 8th to the 14th. Then, extract the remaining expiration date data for each period, calculate the remaining expiration date corresponding to the start date of the period and the remaining expiration date corresponding to the end date of the period. If the expiration date on the end date is less than the expiration date on the start date, it is recorded as a decrease in expiration date; otherwise, it is recorded as an increase in expiration date. For example, batch B001 has a remaining expiration date of 90 days at the start of Period 1 and 84 days at the end of the period, a decrease of 6 days, which is marked as a decrease. At the same time, extract the remaining expiration date data for each period. The direction of inventory quantity change corresponding to the cycle is recorded. For example, if the inventory quantity decreases from 1000 units to 950 units, the inventory direction is a decrease. It is then determined whether the direction of the remaining shelf life is consistent with the inventory direction. If both are decreasing, it is recorded as the same direction. If one increases and the other decreases, it is recorded as the opposite direction. This process is repeated for each cycle to form a direction matching record sequence. The matching judgment direction is set as same direction for same direction and opposite direction for opposite direction. For cycles with unchanged items in between, it is determined whether they constitute a valid trend based on the specific difference. For example, if the shelf life decreases by no more than 1 day and the inventory change is a significant decrease of more than 50 units, it is still treated as the opposite direction to ensure that the direction relationship is accurately defined. The direction matching results of all batches in each consecutive cycle are summarized, sorted according to the cycle number, and marked as "same direction", "opposite direction" or "invalid" status, and output as a direction matching offset sequence.
[0075] The cycle inventory tracking submodule calculates the starting and ending quantities of inventory for each batch in each cycle based on the direction matching offset sequence, analyzes the proportional trend of inventory quantity changes within consecutive cycles, determines the continuity or change status of inventory change direction during the cycle, organizes time sequence data, and obtains the cycle inventory fluctuation trajectory vector.
[0076] For each batch, the initial and final inventory quantities for each period are extracted. For example, batch B001 starts with 1000 units and ends with 950 units in period 1, and starts with 950 units and ends with 930 units in period 2. The difference in inventory quantities between periods is calculated. If a decrease of 50 units is recorded in period 1 and a decrease of 20 units is recorded in period 2, it is considered a downward trend in inventory. Then, it is determined whether the direction of change is consistent in each consecutive period. If both period 1 and period 2 are downward, it is recorded as a continuous decline. If period 1 is a decrease and period 2 is an increase, it is marked as a change in direction. At the same time, the magnitude of the change is calculated, and a threshold of 5% is set for the percentage of change. When the percentage of inventory reduction in a period exceeds 5%, it is marked as a significant decline. For example, if the reduction in period 1 is 50 units, which is 5% of the initial 1000 units... %, Period 2 decreased by 20 units, accounting for 2.1% of 950 units. Period 1 showed a significant decrease, while Period 2 showed a slight decrease. Since the changes in the two periods are inconsistent, they are treated according to the direction of change. In the execution, three or more consecutive periods need to be processed to form a complete trend line segment. Record the direction trend, change amount, percentage and number of consecutive periods for each inventory change sequence. Organize them into an inventory change trajectory record table in chronological order. Example record: [Batch B001, Period 1: Decrease of 50 units, percentage 5%, Period 2: Decrease of 20 units, percentage 2.1%, direction change]. Construct a continuous trajectory vector based on the records. Each element in the vector records the start time of the period, the direction of inventory change and the difference in quantity. Summarize the inventory change vector sequences of all batches and form a complete periodic inventory fluctuation trajectory vector in chronological order.
[0077] The deviation risk assessment submodule calculates the relative change between inventory quantity and remaining shelf life in each cycle based on the periodic inventory fluctuation trajectory vector, analyzes the difference between the two types of relative changes, and uses the following formula:
[0078] ;
[0079] By obtaining the stability deviation from the mean, determining the deviation risk status, and obtaining a batch dissipation-related risk characterization, among which... Indicates the first The batch stability deviates from the mean. This indicates the total number of analysis periods. The periodic numbers, from 1 to This indicates the batch number of the drug. Indicates the first Cycle number Changes in batch inventory quantity Indicates the first The start time of the period Batch inventory quantity, Indicates the first Cycle number Changes in the remaining shelf life of the batch. Indicates the first The start time of the period The remaining shelf life of the batch;
[0080] Stability deviation from the mean refers to the absolute difference between the relative change in inventory quantity and the relative change in remaining shelf life of the same batch of medicine over multiple consecutive periods. This value is obtained by averaging the absolute differences across all periods. The mean reflects the degree of matching between the actual inventory consumption and the remaining shelf life consumption of the batch in each period. Stability deviation from the mean measures the difference between the rate of inventory reduction and the rate of shelf life consumption for a particular batch of medicine across different periods. A larger mean indicates a greater inconsistency between the pace of inventory consumption and the rate of shelf life reduction, suggesting a deviation trend. A smaller mean indicates that the changes in the two are relatively synchronous, with a low degree of deviation.
[0081] A continuous periodic data series is constructed using drug batches as the object, assuming the total number of analysis periods is . For the same batch For the drugs, the original inventory quantity is collected at the beginning of each cycle. Compared with the original value of the remaining validity period At the end of the cycle, the corresponding inventory quantity and remaining shelf life are collected to calculate the change in inventory quantity. and the change in remaining shelf life Subsequently, to address the issue of dimensional discrepancies between inventory quantity and remaining shelf life, a maximum-minimum normalization method was used to unify the dimensions of inventory quantity and remaining shelf life at the start of the period. This normalization method involved mapping between the historical maximum and minimum values of the same batch within the analysis period. However, changes in inventory and changes in shelf life were not normalized separately; instead, they were normalized using subsequent relative change ratios. , After eliminating dimensions, perform difference calculations:
[0082] For example, in the During the cycle, the initial inventory value of this batch at the beginning of the cycle was... The maximum inventory during the period is 200 units, and the minimum inventory is 80 units, corresponding to a normalized inventory value of [value missing]. If the ending inventory for the same period is 90 units, then the original value of the inventory change is... Its relative inventory change ratio is ;
[0083] The original value of the remaining effective period at the beginning of this period was... The maximum validity period within the cycle is 240 days, and the minimum validity period is 120 days, corresponding to a normalized validity period value. If the remaining shelf life at the end of the cycle is 162 days, then the original value of the change in shelf life is... The ratio of relative change in efficacy is ;
[0084] Based on this, the absolute value of the difference between the two types of relative changes during this period is calculated as follows:
[0085] ;
[0086] Continuing to process the data from period 3, where the initial inventory value is 100 units and the normalized value is... The change in inventory is: The ratio of relative inventory change is ;
[0087] The initial remaining shelf life is 150 days, and the normalized value is... The change in remaining shelf life is The relative change in efficacy period is: ;
[0088] The absolute value of the corresponding difference is:
[0089] ;
[0090] Then, the fourth cycle was processed, with an initial inventory of 90 units and a normalized value of [value missing]. The change in inventory is: The ratio of relative inventory change is ;
[0091] The initial remaining effective period is 132 days, and the normalized value is... The change in remaining shelf life is The ratio of relative change in efficacy is ;
[0092] The absolute value of the difference is:
[0093] ;
[0094] The sequence of absolute differences forming three periods is as follows: Substitute the sequence into the formula to perform summation and averaging operations, as follows:
[0095] ;
[0096] Regarding stability deviation from the mean The judgment criteria are divided into the following three intervals:
[0097] when When this occurs, it is determined to be a state with no deviation risk;
[0098] when At that time, it was determined to be a state of moderate deviation from risk;
[0099] when At that time, it was determined to be a state that was highly deviated from the risk level.
[0100] Current calculation results satisfy This corresponds to the first type of risk interval mentioned above. Therefore, it indicates that the relative changes in the inventory quantity and remaining expiration date of this batch of drugs within the current three consecutive cycles are relatively small. The two types of trends show a high degree of consistency on a quantitative scale, and no structural separation or abnormal dissipation behavior has been observed.
[0101] Please see Figure 5 The inventory risk grading module includes:
[0102] The anomaly attribution judgment submodule is based on the batch dissipation association risk characterization, compares the consumption trend type and the change continuity indicator, determines whether the quantity change of the same drug in the inventory records of different hospital areas is synchronized, classifies according to the risk level range, and obtains the anomaly attribution mapping result.
[0103] The consumption trend type field and change continuity flag field are extracted for each drug record. The consumption trend type field is divided into three categories: "rapid consumption," "stable consumption," and "slow consumption." The change continuity flag is divided into three types: "consistent," "alternating direction," and "irregular." Records are then aggregated by hospital area, using drug number as the unit. For example, drug number "D7001" is recorded in hospitals A, B, and C. The inventory quantity changes within each hospital area over consecutive periods are compared. The starting and ending inventory of each period are extracted to determine if the inventory is continuously decreasing. If all three hospital areas show a continuous and consistent decrease (e.g., a decrease of 50 units in period 1 and a decrease of 40 units in period 2), and the difference in direction and quantity between the hospital areas is within 5 units, then the change is considered synchronous. If hospital area A decreases by 50 units, B decreases by 10 units, and C increases by 20 units, then the direction of change is divergent and marked as inconsistent. The inventory synchronization judgment threshold is set to a 5% error range. The difference between inventory reductions must not exceed 5% to be considered synchronous. This is combined with cross-judgment based on consumption trend types. For example, if hospital A experiences rapid consumption, B experiences slow consumption, and C experiences stable consumption, these three are different types and are judged as inconsistent trends. The trend types are then combined with continuity indicators to create a mapping rule matrix. For example, "rapid consumption + continuous consistency" is classified as high-risk, "slow consumption + irregularity" as medium-risk, and "stable consumption + alternating directions" as low-risk. Each combination corresponds to a different numbering range: high risk is range 1 to 20, medium risk is range 21 to 50, and low risk is range 51 to 99. Using the numbering range as the judgment standard, drug number "D7001" falls under the combination of "rapid consumption + continuous consistency" and is classified into range number 15. Based on the matching results, the drug number and its corresponding anomaly classification level number are output and categorized according to their respective risk levels, forming the anomaly classification mapping result.
[0104] The classification mapping adjustment submodule analyzes the distribution information of hospital areas and the frequency of abnormal records based on the anomaly attribution mapping results, compares the mapping relationships between different categories, and performs normalization processing using the following formula:
[0105] ;
[0106] Calculate the risk mapping offset, adjust the classification rule mapping relationship, and obtain the risk classification update result. Indicates drug number In the hospital area Risk mapping offset below, Indicates drug number In category index The abnormal mapping score below, Indicates the hospital area In category index The coupling score below, Indicates the hospital area The baseline mapping score, Indicates drug number The frequency of occurrence of abnormal records Indicates the total number of categories;
[0107] Risk mapping offset refers to the drug number In the hospital area After aggregating the coupling relationship between the abnormal status of each category and the distribution in the hospital area, the normalized absolute deviation from the baseline reference value of the hospital area is obtained by first averaging the product of the drug abnormality score under each category and the coupling score of the hospital category, which reflects the overall abnormal distribution of the drug in the current hospital area; then, the difference between this aggregated value and the baseline reference value of the hospital area is used to measure the degree of deviation; then, this difference is normalized (divided by the square root of the drug abnormality record frequency plus 1) to reduce the direct impact of the number of abnormal records on the results; finally, the absolute value is taken, and only the deviation magnitude is retained; the risk mapping deviation reflects the overall abnormality of the drug under multiple risk statuses in a specific hospital area. Compared with the normal baseline of the hospital area, the larger the value, the higher the abnormal risk level of the drug batch in the hospital area, which is convenient for abnormal classification or risk grading.
[0108] Based on the anomaly attribution mapping results, the risk categories of relevant drugs are obtained, and the distribution of drugs in different hospital areas is analyzed. Combined with hospital inventory records, consumption trends, and historical anomaly frequencies, the risk of each drug is further confirmed. For example, suppose a drug with the code [number missing]... Its anomaly mapping scores under the three risk categories are A certain hospital area The coupling scores under these three categories are The baseline mapping score for the hospital area is The frequency of abnormal records for this drug is: The total number of categories is First, calculate the weighted average term:
[0109] ;
[0110] ;
[0111] Calculate the risk mapping offset:
[0112] ;
[0113] Based on the preset risk range:
[0114] when If the risk level is low, it means that the inventory fluctuation of the drug batch is small and within the normal consumption range, so no special attention is needed.
[0115] when If the risk level is determined to be medium, it indicates that there is a certain degree of abnormality in the fluctuation of drug inventory, which requires regular monitoring and adjustment of inventory management strategies.
[0116] when If the risk level is high, it indicates that the drug inventory fluctuations in the hospital area are significantly abnormal and the risk level is high. This should be given sufficient attention, and further inventory monitoring and risk warning measures should be taken.
[0117] Due to the current calculation The value is greater than 0.1, therefore the drug should be determined to be within the hospital area. The following indicates a high risk level, meaning that the drug's inventory behavior in this hospital area exhibits significant abnormal fluctuations. It should be immediately included in the key monitoring scope, and stricter risk control measures should be implemented in conjunction with inventory optimization strategies and early warning mechanisms.
[0118] The state sequence generation submodule filters the associated hospital area inventory distribution codes and stability deviation markers based on the risk classification update results, judges the state code combination of batch records, optimizes the temporal arrangement of each data, analyzes the classification interval number of each record, and obtains the inventory abnormal state sequence.
[0119] Extract the hospital area code, inventory batch number, and stability deviation flag for each categorized record. Process the deviation flag field with three status values: "Severe Deviation" is assigned a value of 1, "Slight Deviation" is assigned a value of 2, and "No Deviation" is assigned a value of 3. Sort all batch records under the same drug number in chronological order of registration time. For example, if batches B001 to B005 of drug number "D7001" were registered between January and March 2026, sort them by registration time from earliest to latest to form a status processing sequence. Then, screen the classification number of each record. For example, record number 15 is determined to be in a high-risk state, so the status value is set to "A"; record number 38 is set to a medium-risk state value "B"; and record number 74 is set to a low-risk state value "C". This is done by assigning status level letters... The status code combination is generated by concatenating the stability deviation marker number, such as "B2" indicating a medium-risk and slightly deviated status. Then, the status code combinations of the same drug in different batches are compared to determine whether there are continuous identical combinations or coding change trends. For example, the sequence "B2, B2, A1, A1, A1" indicates a gradual transition from medium-risk to high-risk status, forming a continuous and serious deviation. This combination sequence is recorded and classified as a continuous high-risk change trend segment. At the same time, each segment of the sequence is assigned a time range label. For example, batches B003 to B005 are from February 15 to March 10. The output is sorted by the time dimension. All drug number status sequences are summarized to form a complete time-line type status label vector, and are archived by drug number, batch, and hospital area using a triple index. The output is the inventory abnormal status sequence.
[0120] Please see Figure 6 The inventory alert generation module includes:
[0121] The risk classification record filtering submodule analyzes the risk classification number of each batch based on the inventory anomaly status sequence, determines whether each number belongs to the warning level range, compares the mapping between risk level and drug number, and obtains the drug batch index set.
[0122] Extract the batch number and corresponding risk level number from each record, and match them according to a preset risk level range. Divide the risk level numbers into three segments: numbers 1 to 20 are high-risk warning levels, numbers 21 to 50 are medium-risk warning levels, and numbers above 51 are non-warning levels. Iterate through all batch records and match the risk number of each record within the range. For example, if the risk number of batch "B021" is 17, it falls within the range of 1 to 20 and is determined to be a high-risk warning batch, then this batch is retained for the next stage of processing. If the corresponding number of batch "B033" is 38, it falls within the medium-risk warning range and is also retained. If the number of batch "B050" is 67, it exceeds the warning range and is discarded. In subsequent early warning processing, after matching, all batch numbers that meet the early warning range are paired with their drug numbers and merged according to drug number to form a mapping table of drugs and all early warning batches. For example, if there are two batches "B021" and "B022" under drug number "D8041", corresponding to risk numbers 17 and 23 respectively, both of which are within the early warning range, they are integrated into "D8041 to [B021, B022]". If a drug only has batches with non-early warning numbers, it is not included in this mapping table. During the mapping process, duplicate records need to be removed to ensure the uniqueness of batches under each drug number. After the processing is completed, a summary set of drug numbers and all early warning batches is obtained, which serves as the drug batch index set used for subsequent processing.
[0123] The status risk identification submodule is based on the drug batch index set. It retrieves the physical storage location and current inventory status of each batch in the hospital's inventory registration, analyzes the risk marking content of each batch, determines whether there is a feature correlation between the risk marking and the inventory status, and obtains the inventory risk status identifier.
[0124] The system retrieves the physical storage location field and current inventory status field from the inventory registration table for each drug batch. It extracts the batch's storage location code in the hospital pharmacy or warehouse, such as "Cold Storage A-03" or "Cool Zone B-12." It then compares this code with the current inventory status field to determine if the batch is in one of three categories: normal registration, shortage registration, or overstock registration. Next, it extracts the risk marker content generated in the previous stage for this batch. This field might be marked as "High Consumption + Insufficient Expiry Date" or "Fluctuating Changes + High Inventory." The risk marker content is then compared side-by-side with the inventory status field to determine if there is a typical correlation between them. For example, if a batch is marked as "High Consumption + Insufficient Expiry Date" and its inventory status is "High Inventory," this constitutes an unreasonable correlation and is recorded as... An abnormal risk status is identified if the risk is marked as "slow consumption + backlog" and the inventory status is "backlog registration". This constitutes a positive feature match, and the risk status is considered consistent. The judgment criteria are as follows: if any dimension attribute in the risk label is logically conflicting or opposite to the inventory status attribute, it is marked as "risk mismatch". If the two are logically consistent, it is marked as "risk match". For example, if batch "B021" is marked as "rapid consumption + inventory fluctuation", but its inventory status is "stable" for two consecutive periods, it is recorded as a mismatch. Each batch record is marked with a risk status identification flag, and the information is summarized into a complete information table containing drug number, batch number, hospital location, storage location, inventory status and matching judgment results, which is output as the inventory risk status identifier.
[0125] The abnormal information integration submodule, based on the inventory risk status identifier, extracts the associated risk level, consumption trend and distribution data according to the drug number, batch code and hospital location, integrates them into unified warning information, and counts the batch records marked as abnormal, and obtains the inventory warning signal push results.
[0126] For each record, extract the drug number, batch number, and physical location code of the hospital. Then, retrieve the corresponding risk level code, consumption trend type, and current inventory distribution data to construct a unified set of abnormal information. Assemble each record into a complete information unit; for example, a record format like: [D8041, B021, Cold Storage A-03, Risk Level: 18, Trend: Rapid Consumption, Inventory Status: Overstock]. After integrating all batches, extract the flag values from the entire table, filtering out all batches marked as "Risk Mismatch" or "High Risk." Count their quantity, drug number, hospital code, and batch number. The information is used to create an anomaly warning statistical summary table. The table structure is as follows: [Drug Number, Number of Abnormal Batches, Number of Hospitals Involved]. This is to make a macro-level judgment on the abnormal status of the entire hospital. In the field integration, the case where different batches under the same drug number have multiple abnormal markings is deduplicated. Only the time node of the earliest abnormal record is retained as the warning reference point. Based on this, the final warning push content is generated. The fields such as drug number, batch code, abnormal status mark, involved hospital area, physical location and consumption trend are merged into a unified output format to form independent warning message structures. After being summarized, they are used as the inventory warning signal push results.
[0127] 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 drug inventory early warning system, characterized in that, The system includes: The inventory status verification module is based on the hospital pharmacy inventory records. It compares the relationship between drug number and batch number, verifies the batch information of incoming goods, filters the quantity according to the expiration date, and compares the consistency of the source to obtain inventory status data for multiple hospital areas. Based on the multi-hospital area inventory status data, the inventory change direction determination module determines the continuous changes in drug inventory, analyzes the direction of increase and decrease, compares the continuity of changes in the same direction, identifies records with consistent changes, updates the status flag, and obtains an abnormal inventory fluctuation identifier. Based on the abnormal inventory fluctuation identifier, the batch stability correlation module analyzes the batch expiration date and inventory records, filters multiple period changes of the same batch, compares the matching status of the expiration date and the direction of change, judges the stability deviation, and obtains the batch dissipation correlation risk characterization. The batch stable association module includes: The expiration date matching and verification submodule analyzes the associated drug number and batch number based on the inventory fluctuation anomaly identifier, determines the relationship between the direction of change of remaining expiration date and the direction of increase or decrease of inventory within a continuous period, compares the same or opposite states within each period, identifies the same and opposite period situations, and obtains the direction matching offset sequence. Based on the direction matching offset sequence, the cycle inventory tracking submodule calculates the start and end quantities of the inventory of the batch in each cycle, analyzes the proportional trend of inventory quantity changes in continuous cycles, determines the continuity or change status of the inventory change direction during the cycle, organizes the time sequence data, and obtains the cycle inventory fluctuation trajectory vector. The deviation risk assessment submodule calculates the relative change between inventory quantity and remaining shelf life in each period based on the cycle inventory fluctuation trajectory vector, analyzes the difference between the two types of relative changes, and uses the following formula: ; By obtaining the stability deviation from the mean, determining the deviation risk status, and obtaining a batch dissipation-related risk characterization, among which... Indicates the first The batch stability deviates from the mean. This indicates the total number of analysis periods. The periodic numbers, from 1 to , This indicates the batch number of the drug. Indicates the first Cycle number Changes in batch inventory quantity Indicates the first The start time of the period Batch inventory quantity, Indicates the first Cycle number Changes in the remaining shelf life of the batch. Indicates the first The start time of the period The remaining shelf life of the batch; Based on the batch dissipation-related risk characterization, the inventory risk classification module compares the corresponding relationships of hospital areas, analyzes the deviations between inventory anomalies and stability, determines the record belonging interval, adjusts the mapping relationship and classifies the data, and obtains the inventory anomaly status sequence. The inventory risk classification module includes: The anomaly attribution judgment submodule, based on the batch dissipation association risk characterization, compares the consumption trend type with the change continuity indicator to determine whether the quantity changes of the same drug in the inventory records of different hospital areas are synchronized, classifies them according to the risk level range, and obtains the anomaly attribution mapping result. The classification mapping adjustment submodule analyzes the distribution information of hospital areas and the frequency of occurrence of abnormal records based on the abnormal attribution mapping results, compares the mapping relationship between each category, calculates the risk mapping offset, adjusts the classification rule mapping relationship, and obtains the risk classification update result. The state sequence generation submodule, based on the risk classification update results, filters the associated hospital area inventory distribution codes and stability deviation markers, determines the state code combination of batch records, optimizes the temporal arrangement of each data, analyzes the classification interval number of each record, and obtains the inventory abnormal state sequence. The inventory early warning generation module analyzes the risk batch records based on the inventory anomaly status sequence, determines the distribution location of the risk batch records, identifies the registration status and stability risk, integrates the anomaly association information, and obtains the inventory early warning signal push result.
2. The drug inventory early warning system according to claim 1, characterized in that, The multi-hospital area inventory status data includes unique drug identifiers, batch allocation information, and hospital distribution. The inventory fluctuation anomaly identifiers include consumption trend type, change continuity indicator, and anomaly status code. The batch dissipation associated risk characterization includes dissipation rate characteristics, batch retention attributes, and risk identification number. The inventory anomaly status sequence includes graded interval numbers, an abnormal drug batch list, and risk category information. The inventory early warning signal push result includes the early warning target hospital area, early warning batch code, and risk response prompt.
3. The drug inventory early warning system according to claim 1, characterized in that, The inventory status verification module includes: The data mapping and extraction submodule analyzes each drug number and batch number based on the pharmacy inventory records in the hospital area. By comparing batch information in groups, it calculates the order of entry time for each batch under the same drug number, judges the completeness of the mapping relationship between data, and obtains the drug batch mapping sequence. The expiration date screening calculation submodule filters the remaining expiration date and inventory quantity of each batch based on the drug batch mapping sequence, determines whether the batch meets the expiration date requirements, compares the synchronicity between the inventory quantity and remaining expiration date of the batches, removes drug batches that do not meet the conditions, and obtains the expiration date applicable inventory information. The consistency verification and correction submodule analyzes the relevant drug batches based on the expiration date applicable inventory information, compares the source of each data with the upload process, determines whether the data content is consistent, adjusts inconsistent items from different sources, and unifies them into a structured data format to obtain multi-hospital area inventory status data.
4. The drug inventory early warning system according to claim 1, characterized in that, The inventory change determination module includes: The inventory trend calculation submodule analyzes the inventory quantity of each drug number in a continuous time period based on the inventory status data of the multi-hospital area, calculates the inventory change between any two consecutive time nodes, determines whether the inventory of each drug number increases or decreases in each time period, and obtains the sequence of drug inventory change direction. The change continuity judgment submodule compares the inventory change direction of adjacent time periods based on the sequence of changes in drug inventory, filters out drug records whose inventory change direction remains consistent over multiple consecutive time periods, marks the records with continuous feature tags, and obtains a set of inventory change continuity tags. The status tag update submodule adjusts the corresponding hospital records based on the inventory change persistence tag set, updates the inventory status tag field, and collects drug number data with continuous change characteristics to obtain an inventory fluctuation anomaly identifier.
5. The drug inventory early warning system according to claim 1, characterized in that, The inventory early warning generation module includes: The risk classification record filtering submodule analyzes the risk classification number of each batch based on the inventory anomaly status sequence, determines whether each number belongs to the warning level range, compares the mapping between risk level and drug number, and obtains the drug batch index set. The status risk identification submodule, based on the drug batch index set, retrieves the physical storage location and current inventory status of each batch in the hospital's inventory registration, analyzes the risk marking content of each batch, determines whether there is a feature correlation between the risk marking and the inventory status, and obtains the inventory risk status identifier. The abnormal information integration submodule, based on the inventory risk status identifier, extracts the associated risk level, consumption trend and distribution data according to the drug number, batch code and hospital location, integrates them into unified warning information, and counts the batch records marked as abnormal, thus obtaining the inventory warning signal push result.
6. The drug inventory early warning system according to claim 1, characterized in that, The batch information refers to the production batch number, warehousing batch, and expiration date batch of the drug. The consistency of source refers to the degree of consistency and matching between different data sources for the same drug or batch data.
Citation Information
Patent Citations
Cross-border e-commerce logistics warehouse management system
CN118710188A
Hospital comprehensive monitoring analysis method and platform based on artificial intelligence
CN120412950A