The present relates to a computer-implemented method formanaging an electronic pillbox. The method generates a patient record and anelectronic pillbox associated to the patient record. The electronic pillboxcomprises at least one drug. The method generates for each drug in theelectronic pillbox a medication schedule. The medication schedule comprisesat least one period of the day, and a quantity of the drug to be taken forthatperiod. The method also determines a period of time, generates an instance ofthe electronic pillbox for the determined period of time, and allocates auniqueidentifier to the instance of the electronic pillbox. The instance of theelectronicpillbox comprises the medication schedule for the determined period of timeforeach drug in the electronic pillbox. The present also relates to a computerprogram product for implementing the method.