Electronic health records (EHRs) often contains ICD codes used for billing purpose. Is there any study/survey that looked at how often ICD codes in EHRs reflect the actual diagnosis?
In many cases they do reflect the actual diagnosis. It depends on the disease in question.
eMerge network work on validation is for example here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3715338. In that study, they used ICD-based definitions but also other available data.
Similar work in diabetes mellitus diagnosis is also published (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4416392/)
Validation research tries to arrive at positive predictive value. E.g., https://www.ncbi.nlm.nih.gov/pubmed/30480162
In Japan, the PPV for AMI was 82.5%. (https://www.ncbi.nlm.nih.gov/pubmed/30477501)