This answer got me wondering, The Doctor spent seven years on Voyager and expanded out of his role to a significant degree, not to mention he is literally a part of the ship, so it would make sense that he would be able to accomplish many advanced engineering tasks on it, and if I remember he did actually perform some engineering work on Voyager. Despite that, did he ever actually mention any knowledge or ability gained from the grafting of the EMH Diagnostic program onto his?
IIRC they only grafted subroutines, not the whole program, so it's likely that the memory files were dumped.
As far as the doctor ever stating "I got this subroutine or knowledge from the time I was going into cascade failure and they grafted another program onto me"… no, he never says anything like that.
He frequently mentions altering his own programming though.
My interpretation of that episode is that they dumped the diagnostic program to make space for further expansion of the Doctor's program. So the diagnostic program was entirely wiped, making it impossible for the Doctor to access any part of it. They "grafted" the space used by the memory onto the Doctor's program. Think of it as a Linux file system. It is possible to limit the size of a file at any value you wish, as opposed to the traditional view of Windows file systems where you can keep on adding files or expanding existing files until the disc runs out of space. So let's say that the Doctor's file was 20% of Voyager's total storage and that the diagnostic program was another 20%. The remaining 60% is for other systems such as propulsion, astrometric data, replicator patterns, holodeck programs, music, literature, personal files, crew logs, etc. Each system has a maximum allocation so they can't simply wipe out most of the computer's memory to make way for the Doctor. A lot of the Doctor's computer memory (as opposed to his own memories) is allocated to behavioural and medical diagnostic subroutines. Only a part is used for his own memories and experiences which is why adding more memory significantly extended his running time. If he was left running for long enough the problem would eventually recur.