In a recent study of electronic health records (EHR) of general practitioners in a livestock-dense area in The Netherlands in 2009, associations were found between residential distance to poultry farms and the occurrence of community-acquired pneumonia (CAP). In addition, in a recent cross-sectional study in 2494 adults in 2014/2015 an association between CAP and proximity to goat farms was observed. Here, we extended the 2009 EHR analyses across a wider period of time (2009-2013), a wider set of health effects, and a wider set of farm types as potential risk sources. A spatial (transmission) kernel model was used to investigate associations between proximity to farms and CAP diagnosis for the period from 2009 to 2013, obtained from EHR of in total 140,059 GP patients. Also, associations between proximity to farms and upper respiratory infections, inflammatory bowel disease, and (as a control disease) lower back pain were analysed. Farm types included as potential risk sources in these analyses were cattle, (dairy) goats, mink, poultry, sheep, and swine. The previously found association between CAP occurrence and proximity to poultry farms was confirmed across the full 5-year study period. In addition, we found an association between increased risk for pneumonia and proximity to (dairy) goat farms, again consistently across all years from 2009 to 2013. No consistent associations were found for any of the other farm types (cattle, mink, sheep and swine), nor for the other health effects considered. On average, the proximity to poultry farms corresponds to approximately 119 extra patients with CAP each year per 100,000 people in the research area, which accounts for approximately 7.2% extra cases. The population attributable risk percentage of CAP cases in the research area attributable to proximity to goat farms is approximately 5.4% over the years 2009-2013. The most probable explanation for the association of CAP with proximity to poultry farms is thought to be that particulate matter and its components are making people more susceptible to respiratory infections. The causes of the association with proximity to goat farms is still unclear. Although the 2007-2010 Q-fever epidemic in the area probably contributed Q-fever related pneumonia cases to the observed additional cases in 2009 and 2010, it cannot explain the association found in later years 2011-2013.