Web-Based Inventory Application and Prediction Using Naive Bayes Algorithm (Case Study: Puskesmas Kecamatan Sawah Besar)

The development of information systems and technology affects various fields, including health, namely Puskesmas. The Sawah Besar District Health Center has several work units, one of which is a stock management unit. The stock management unit in carrying out its duties has problems including data management that still uses Microsoft Excel. When using Microsoft Excel, information about stock data not integrated between different work units, thus hampering the process of accessing documents. The process of approval and stock prediction is also still done manually using physical documents. PHP programming language with Bootstrap Framework and MySQL used to develop applications. While PHP-ML library which implement Naive Bayes algorithm is used for stock prediction. The features developed in this study can be used by related units to simplify the stock data collection process, assist in the stock approval process and speed up the preparation of stock inventory reports. In addition, there is a stock prediction feature that can help users so to support while making decisions in the procurement of drug stock at the Sawah Besar District Health Center to determine whether certain drugs need to be added or not.


INTRODUCTION
The development of information systems and technology has now affected various fields including the health sector, namely health centers. The use of information systems that can be applied to health centers, one of which is the data processing process.Technology utilization can make performance more optimal [1]. The Sawah Besar District Health Center provides health services to the community, especially in the Central Jakarta area. The Sawah Besar District Health Center has several work units, one of which is a stock management unit. This unit has several duties and responsibilities in the process of managing stock The Sawah Besar District Health Center also experienced difficulties in predicting stock. So far, stock procurement has been carried out using manual estimates from the previous period. So there is often a stock calculation error that has an impact on stock availability. Lack of stock will hamper the distribution process. While the excess stock will eventually expire. So it needs to be exterminated. The list of drugs destroyed due to expiration can be seen in Table 1.

Tabel 1.Expired Drug Destruction[2]
Year  [4], using the Naive Bayes method to predict the items with the highest demand in PT Putradabo Perkasa. The results of the analysis can be used to prepare for the supply of the best-selling products. The results of the study have a data accuracy of 78.33%. Reference [5], classify data using the Naive Bayes method using the PHP-ML library component or PHP-Machine Learning to detect news Hoaxspeak Indonesian. Based on the test results, this system produces an accuracy of 82.6% statically and 68.33% dynamically.
Inventory comes from the word "inventory" which means a list of goods. Inventory is a deposit of raw goods and finished goods that are used for the future within a certain period of time [6]. Meanwhile, the definition of inventory according to the KBBI is the process of recording or registering company property used in carrying out work. Inventory is a series of processes for data collection, recording, reporting, and documentation of stock data that functions as a tool to support company activities. This data is a record of all tools and materials provided for company operations [7]. Naive Bayes algorithm is a classification with probability and statistical methods [8]. This algorithm is able to predict future opportunities based on past experience [9]. General form of classification Naive Bayes as follows:

Figure 1. Naïve Bayes Formula
With: X = Data with unknown class H = Hypothesis data X is a certain class label P(H|X) = Probability of hypothesis H based on condition X (posteriori probability) P(H) = Probabilistic hypothesis H (prior probability) P(X|H) = Probability of X based on conditions in hypothesis H P(X) = Probabilistic X Fishbone diagrams or also often called Cause-and-Effect diagrams are a method of improving quality [10]. This diagram shows an impact of a problem with various causes.

SDLC or System Development Life
Cycle is a sequence of several gradual processes in designing or developing a system [11]. The Waterfall model is one of the software development models in the SDLC. The Waterfall method works linearly or sequentially with stages starting from the stages of analysis, design, system development, testing and implementation. Figure 2. describe waterfall method [11]. 1) Analysis In this stage, begins to analyze what only the needs of the system, starting from the needs functional system and non-requirements functionality of the system. The results of the analysis are in the form of system advantages and Awalia Nurfaida, Riska Yulianty Ali Syabana, at all | 867 disadvantages, system functions, to applicable updates. Fishbone is used for analyze the system.

2) Design
The design stage is the next stage of analysis stage where in this stage it is presented design design of applications such as design between advance, and the design of the database to be applied into the system that will made. The application design uses UML modeling.

3) System Development
Application development using the PHP programming language with Bootstrap Framework, MySQL database and for Prediction stock, after the data prepared, there is script to be run (in GUI button to be hit) which implement Naive Bayes method by calling PHP-ML library component. The calculation steps using Naive Bayes are [14]: • Prepare the data to be used • Calculating the frequency of each attribute for each category • Counting the possible values of "yes" and "no" taken from the table probability of occurrence of each attribute value. • Calculating the probability value by normalizing the possibilities for each category • Determine the classification based on the highest score

4) Testing
The test stage is the final stage in the method waterfall where in this testing stage use blackbox testing [12]. Black box testing is a test carried out to observe the results and check the functionality of the application [13]. Here are types of testing from the Black Box Testing method: • Equivalence Partitioning, this test is carried out on forms that already exist in the inventory application system. • Boundary Value Analysis, this test is to ensure that the data entered if it exceeds a predetermined limit cannot be stored properly in the database.
• Comparison Testing, comparing the appearance of the interface on different web browsers. • Sample Testing, to ensure that the selected results can produce good data and are in accordance with the input. • Robustness Testing, the examiner will enter random data to prove that there is no error if the input is invalid. • Behavior Testing, this test is done by creating new data repeatedly to avoid stack data. • Performance Testing, this test evaluates the system's ability to operate properly. • Requirements Testing, requirements specification from system manufacture to testing. • Endurance Testing, to determine whether the results of the algorithm operation on this system are right or wrong. • Cause -Effect Relationship Testing, tests that involve input conditions starting from Input, View, Update, Delete and Search.

5) Implementation
Implementation is the final stage in making Waterfall. At this stage the system has been created, testing and confirmed to work properly.

RESULTS AND DISCUSSION
Data collection is done by observation, interviews and literature study. The results obtained are in the form of current business process flows. Figure 3 Describe the flow of inventory business process.  In figure, the inventory business process begins with a request for goods made by the receiving poly or distribution unit such as a puskesmas from the kelurahan under the auspices of the Sawah Besar Subdistrict Health Center. This request is in the form of a form on a piece of paper containing the stock requirements. Furthermore, the goods manager checks the stock to ensure the requested goods are available. If the goods are available, the Goods Management section will submit an approval for the release of goods to the Head of the Administrative Section (TU). On the other hand, if the requested item is not available, the Goods Management section will make a stock procurement document. Furthermore, the documents are checked to then look for the sender or distributor. The distributor who has been determined then prepares a stock order and sends it to the Sawah Besar District Health Center. After the sender sends the goods, then the goods manager will receive the goods and check. If the goods are in accordance with the order, the goods manager will record the procurement of goods and store them in the warehouse.
The requirements analysis stage is carried out by analyzing the problem data obtained in the previous stage so as to produce alternative solutions to the application needs to be made. This stage is carried out using a fishbone diagram an can be seen in figure 4.

Figure 2. Fishbone Analysis
Based on the results of the analysis of the problems above, a stock inventory application will be made with the following features: 1) The web-based system can be accessed by admin users, superiors and goods managers at the Sawah Besar District Health Center.

2)
There is a dashboard menu that contains information on stock approaching expiration, information on stock nearing out, information on stock distribution, transaction information on recipient policies and sender transactions.

3)
There is a form menu, procurement sub menu and reduction sub menu.

4)
There is an approval menu, procurement sub menu and reduction sub menu.

5)
There is a master data menu, stock data sub menu, sender data and recipient master data.

6)
There is a report menu, procurement report sub menu and reduction report.

7)
There is a stock prediction menu.

8)
There is a Search feature to facilitate data search.

9)
There is a feature to download reports. 10) There is a feature to download details of stock master data, sender master data and recipient master data.
The application design is carried out using UML modeling(Unified Modeling Language).The following is the design of the UML Use Case Diagram that describes the interaction of all actors with the system. There are 3 actors, namely admin, supervisor and goods manager who are interconnected with the system but have different access. Use Case Diagram can be seen in Figure 5.  Health Center consists of a User Class which functions to store user data that can access the system. The Sender class functions to store sender data from both suppliers and from related agencies. The Recipient Class contains information on stock recipients such as poly at the Sawah Besar District Health Center itself and the village health center. The Goods class is useful for storing information on goods which include drugs, medical devices (alkes) and infrastructure (sarpra). Detail_Barang class to provide detailed information about the amount of stock and expiration information. Procurement Class contains information on incoming goods procurement. Reduction class serves to store information on the reduction of goods distributed to recipients. Class Notes contain information on notes or reject information on procurement or stock reduction. The Master_Prediction class contains the data used in the stock prediction process.
The application is started to develop based on the design that has been made. Application development is carried out using the PHP programming language and the Bootstrap CSS and MySQL framework. The design will produce a system in which it is displayed with an attractive user interface.

Figure 5. Expired Stock Dashboard View
Excess old stock will eventually expire. So it needs to be exterminated. In figure, The Expired Stock Dashboard page can be accessed by all users. Users can get information about stock that has or will expire in the diagram. This feature can help users to sort items that will or have expired.

Figure 6. Stock Procurement Form Display
In figure, Procurement can only be accessed by the Goods Manager user. The Goods Manager accesses the procurement form sub menu, then click the "Create" button and click the "Add" button to add stock details that will be requested. The user fills out the form provided and clicks the "Save" button. If there is a change in stock details, you can "Edit" data and "Delete" for data delete data. The created form will have the status of "Draft" and will be continued to superior.

Figure 7. Stock Procurement Approval Display
In figure, Actors access the approval menu and sub menu procurement. Stock Procurement Approval page can only accessed by superior users. If the Goods Manager has entered the transaction, the transaction must first obtain approval from the superior. The superior user must check the transaction whether the data that has been inputted is correct or not, the way the user clicks the "Approve" button to approve the stock procurement or "Reject" to reject the procurement.

Figure 8. Stock Procurement Report View
In figure,On the stock procurement report page, it will display incoming procurement data such as transaction number, date of receipt, sender name, item name, unit and quantity. All users can search for information related to stock procurement transactions by entering the period, namely the start date and end date. After that, the procurement transaction will be displayed in the application, if the user wants to download it in the form of an excel file, they can click the Export Excel button.
In figure 11., The data obtained for doing stock prediction are data Usage Report and Drug Request Sheet (LPLPO) at the Sawah Besar District Health Center between year 2019 and 2020.

Figure 11. Dataset LPLPO
Prediction stock start with data transformation by identify and convert data to determine the parameters to be used. At this stage, the data is changed to be simpler and converts the stock value of procurement and reductions that exist in the LPLPO data into a statement of "1" for stocks that are worth more than 0 and "0" for stocks that are equal to 0. Then the number of transactions will be calculated for procurement and reduction. If the procurement transaction is equal to or more than 5 transactions, it is categorized as "Yes". However, if the number of procurement transactions is less than 5, then it is categorized as "No". Likewise with reduction transactions. So we get a new dataset that has been converted as show in figure 12. In figure, The initial step is to import the Naive Bayes classification and then select the dataset used, then the samples/attributes and labels are separated from the dataset, then the classification is called or trained using Naive Bayes, then the results are called using predict data testing that has been inputted and the results will be displayed on application.

Figure 14. GUI Stock Prediction Calculation Display -Calling Script Naive
Bayes Algorithm using PHP-ML In figure, On the stock prediction calculation page, all users can perform stock prediction calculations based on the previous period. The user selects the year and clicks the "prediction menu" button first to find out the prediction results.
Result is showing which items should be add regarding the less of amount. The Button will calling script containing Naive Bayes Algorithm using PHP-ML in the stock inventory application of the Sawah Besar District Health Center.
To minimize errors (errors) in the application that has been made, testing is carried out using the Blackbox Testing method. Detail black box test can be seen in Table 2.

CONCLUSION
The web-based inventory system at the Sawah Besar District Health Center with the features that have been developed in this study can be used by related units to simplify the stock data collection process, assist in the stock approval process and speed up the preparation of stock inventory reports. In addition, there is a stock prediction feature that can help users so that the results can be obtained used as a supporting reference in making decisions in the procurement of drug stock at the Sawah Besar District Health Center to determine whether certain drugs need to be added or not.