A programmable medication dispenser is provided to securely dispense medication to a patient and mitigate the risk of diversion of the medication to an unauthorized user. The programmable medication dispenser may include a processor, a memory, a housing, a biometric verification module, an inner receptacle having a plurality of compartments for storing the medication, and a gate for dispensing the medication from one of the compartments. A patient may access the medication stored within the medication dispenser according to a prescribed dosing schedule based on instructions executed by the processor after verifying his or her identify via the biometric verification module. A system is also provided for securely dispensing, monitoring, controlling medication for a patient using the programmable medication dispenser and for mitigating the risk of diversion of the medication to an unauthorized user. The system could be implemented in a cloud-based environment wherein centralized, cloud-based monitoring and control of a network of medication dispensing systems is provided, and the system could function as a centralized portal for allowing healthcare providers to access patient healthcare data, as well as for allowing insurers and other entities to access such data, as needed.