Midaz as a Pharmacy Ledger
Last updated
Last updated
Although the concept of a ledger is closely associated with financial transactions, Midaz can be used to store a wide variety of applications that require transactions to function. A classic example of this is using Midaz for inventory management in a pharmacy.
Let's suppose a large pharmaceutical company called Doe's Pharma operates in the United States, Canada, Brazil, Spain, and Angola. For this, in North America, it has another parent organization with two ledgers, and for the other countries, it has directly linked ledgers, as shown in Figure 1.
Once this is done, a portfolio could be created for each store in the network using the Create a Portfolio endpoint.
And for each pharmacy, two accounts would be created: one to represent the quantity of medications in the stock and the other for the quantity of medications on the shelves for sale, using the Create an Account endpoint.
With this setup, whenever a medication is sold, it would move from the soho_main
account to the @external/MED-12345-S-BL
account (the account representing assets leaving the ledger because they were sold). Whenever inventory is moved from the stock to the shelves, it would move from the soho_warehouse
account to the soho_main account, and whenever it is restocked, the reverse path would be followed. Thus, during report generation, the total inventory of the pharmacy, as well as the purchases and sales of medications, could be generated using Midaz's infrastructure.
Going even further, if users were to pay using a digital account from Doe's Pharma, the financial flow could also be handled using Midaz.
Imagine that the pharmaceutical company has various medications, including Medicine A, Medicine B, and Medicine C. Each of these medications would be an Asset created using the endpoint, as shown below.