Grok AI-based pharmacy inventory management program, 2-barcode inventory management


Hello, this is Ilwon Station Exit 1 Pharmacy.

Today, I will tell you about the pharmacy inventory management program that I created with the help of A, Grok.

I am not a programming expert, but I solved the problem using AI to implement the functions that are absolutely necessary for pharmacies.

Problems and needs in pharmacies

Pharmacies order prescription drugs (prescription drugs) from wholesalers.

Prescription drugs are drugs that require a doctor's prescription, and the management process is complicated.

The problem occurs when the drug price is reduced (when the drug price goes down) or when returning the product.


In order to return the product, you need to register with the wholesaler that ordered the product,

but since the same drug is ordered from multiple wholesalers,

you have to check the order history and

compare the 2D barcode or RFID information through the wholesaler one by one.


In pharmacies, the process of receiving (medicine coming in) and shipping (giving medicine to patients) is repeated every day. However, since there was no tool or program to systematically manage 2D barcodes or RFID,

I had to manually match the order record and wholesaler when returning a drug.


This process took a long time, and if I made a mistake, I had to go back to the wholesaler, which was a hassle.


I needed a pharmacy inventory reporting program, but the existing prescription entry program company did not help me.

Solution with AI Grok

To solve this problem, I asked the pharmacy computer program company to add a drug inventory management function with 2D barcodes.

But they refused so I decided to make it myself~!


The AI, Grok, developed by xAI was a great help to me, who lacked programming knowledge.

I developed it based on my experience creating a medication guide label program through Grok.

How the pharmacy program works

The pharmacy inventory program I created is simple yet practical.

I will explain how it works step by step.

1. Enter wholesaler information

Register the wholesaler barcode information you created directly in the program. After entering the barcode of ‘Wholesale A’, scan the barcode with the scanner and the program will remember it.


2. Scan the wholesaler when receiving

When the medicine comes into the pharmacy,

scan the barcode of the wholesaler that sent the medicine.

Then the program will automatically recognize the wholesaler.


3. Save the 2D barcode of the medicine

Then, when you scan the 2D barcode of each medicine,

the program will save the wholesaler and the date (time) of receipt.

This is like attaching a digital record to the medicine you ordered.


4. Search when reducing the price/returning the medicine

When the price is reduced or a return is needed,

search the 2D barcode of the medicine and the receipt date and wholesaler will appear right away.

Example: “March 1, 2025, Wholesale A”. This will allow you to process quickly.

Data storage and stability

The data of this pharmacy inventory program is saved in JSON and TXT files.

JSON is a format that organizes data neatly,

and TXT is a simple text file. If you save in two ways, you won't lose previous data even if you update the program.

For example, even if you add a new feature, the existing receipt record will remain.

This is a way for a program that I, a non-expert, made to eliminate the anxiety that existing data will disappear with a future update and to increase stability.

Collaboration process with Grok

Grok doesn't give you perfect code from the beginning. 

When I told him what I wanted, he suggested a code, but errors occurred when I ran it.

Since it uses a device outside the computer called a barcode scanner, there were problems with data recognition, storage, and errors.

There are still some errors, but they are being improved.

Every time, I asked Grok for errors and corrections, and after repeated trial and error,

I completed a program that can be used in the field.

Pros and effects of the program


Thanks to this pharmacy inventory program, drug price reductions and returns have been processed faster.

In the past, I had to manually find wholesaler records, but now I can do it with just one 2D barcode scan. 

It saves time and reduces mistakes.

Future goals

I gained confidence while making this program with Grok. I am not an expert, but I think that with AI, we can create more tools (programs) needed for pharmacies.

In the future, I would like to develop a pharmacy-related assistance program or a system for patient convenience.

I plan to run the pharmacy smarter by challenging myself to create an AI program.


✅ Pill counting Android app development → Simple shooting without limit on the number of shots

And developing an app that can automatically save and print

✅ Developing real-time subway information notifications for up and down lines at Ilwon Station on Line 3 through the Seoul Open Data Plaza OPEN API (service for patients and pedestrians passing by the pharmacy)

Ilwon Station Exit 1 Pharmacy has improved the efficiency of the pharmacy with the help of Grok and AI,

and will continue this effort in the future.

I hope this will be helpful to those interested in running a pharmacy.

Please visit often!



Previous Post Next Post