Linear or logistic regression with aggregated data

I'm kind of stuck on a simple question:

I have aggregated data over 15 years for each year how many people in a patient group have received a certain medication X (1105 with X from 2566 patients total in 2016...). The question is now is there a trend? In a similar paper, a logistic regression was calculated and an odds ratio reported. I'm not sure how to calculate a logistic regression from this aggregated data?!? I would have simply calculated a simple linear regression over the relative frequencies (the total number of patients treated varies from year to year)? What would be a correct handling of this kind of data?

| drug X .   | All Patients|     year     |
|------------|-------------|--------------|
| 1394       |        1491 |     2001     |
| 1463       |        1544 |     2002     |
| 1492       |        1585 |     2003     |
| 1511       |        1587 |     2004     |
| 2041       |        2146 |     2005     |
| 2271       |        2383 |     2006     |