The electrical side of a pump is where the codes come up (primary or secondary electric codes), but generally not pump flow, since the computer doesnt monitor it, per se. Like I said before, a lean code can indicate a weak pump, but other things can cause that code also. The thing with codes is that they give us an area to search, but dont absolutely tell us what component is at fault.
WIth the EGR, I might clean it and use a meter to see if the EVR is calibrated. Then see what codes pop up in the future. FWIW, if the EGR fails (doesnt open at part throttle), it can cause a leanness at part throttle, which could pop a lean code. And if the EGR opened at idle, it could cause a rough idle or stalling. Again, the deductive process at work. Diagnostics are needed to know better.
And you can pull your own codes with a paperclip if you desire (I like to actually see the codes myself). As enthusiasts, we might try and clean a component, rather than replace it. I understand the dealer (or a shop's) perspective - they dont want a come-back, so they tend to be a little broad in their diagnoses sometimes. I would do the same if I had a shop.
Anyhow, post more info and we can help.
Good luck.