You can deduct all 310 miles for medical visits (19 cents per mile driven for medical purposes).
Keep in mind, however, that the IRS allows you to deduct qualified medical expenses that exceed 10% of your adjusted gross income for the year. Your adjusted gross income (AGI) is your taxable income minus any adjustments to income such as deductions, contributions to a traditional IRA and student loan interest.
For example, if you have a modified adjusted gross income of $45,000 and $5,475 of medical expenses, you would multiply $45,000 by 0.10 (10 percent) to find that only expenses exceeding $4,500 can be deducted. This leaves you with a medical expense deduction of $975 (5,475 - 4,500).
There is a temporary exemption from Jan. 1, 2013 to Dec. 31, 2016 for individuals age 65 and older and their spouses. If you or your spouse are 65 years or older or turned 65 during the tax year you are allowed to deduct unreimbursed medical care expenses that exceed 7.5% of your adjusted gross income. The threshold remains at 7.5% of AGI for those taxpayers until Dec. 31, 2016.
Thus, all of your unreimbursed medical expenses added up together (including mileage) must exceed 10% of your AGI (7.5% if you 65 or older) in order to be deductible. [Edited 3/04/17]