The preparation of formula has been performed with manual calculations on a paper-based tracking system which is prone to errors and may result in adverse patient safety events due to human error. Utilizing pharmacy technology in the electronic health record, customized formula recipes can be accurately calculated using automated compounding systems. Additionally, other safety features can be implemented using this technology, including barcode scanning for product verification, tracking lot numbers and expiration, delivery tracking and positive patient identification during formula administration. The EHR includes inventory management capabilities. The innovative use of pharmacy tools combines the accuracy and efficiency of technology providing a safe method of formula preparation and administration in healthcare settings.