Added checks to AssignedMedicamentFactory