A handheld electronic device, such as a smartphone, and an app capture an image of a medication or delivery device at the time of delivery with a date and time indictor or stamp. The image is analyzed and the dosage calculated from the captured image. The device stores the data corresponding to the dosage and time and compares the data with stored information relating to the patient to record compliance with the prescribed medication and delivery protocol. The data is used to record total usage of the medication over a predetermined period of time and determine a time schedule for resupplying the medication and a delivery method when the total medication usage exceeds a predetermined amount.