Per IRS Publication 502 Medical and Dental Expenses, page 6:
You can include in medical expenses amounts you pay for special equipment installed in a home, or for improvements, if their main purpose is medical care for you, your spouse, or your dependent. The cost of permanent improvements that increase the value of your property may be partly included as a medical expense. The cost of the improvement is reduced by the increase in the value of your property. The difference is a medical expense. If the value of your property isn't increased by the improvement, the entire cost is included as a medical expense.
Certain improvements made to accommodate a home to your disabled condition, or that of your spouse or your dependents who live with you, don't usually increase the value of the home and the cost can be included in full as medical expenses. These improvements include, but aren't limited to, the following items:
Only reasonable costs to accommodate a home to a disabled condition are considered medical care. Additional costs for personal motives, such as for architectural or aesthetic reasons, aren't medical expenses.
Capital expense worksheet. Use Worksheet A in Publication 502 to figure the amount of your capital expense to include in your medical expenses.
Operation and upkeep. Amounts you pay for operation and upkeep of a capital asset qualify as medical expenses, as long as the main reason for them is medical care. This rule applies even if none or only part of the original cost of the capital asset qualified as a medical care expense.
Improvements to property rented by a person with a disability. Amounts paid to buy and install special plumbing fixtures for a person with a disability, mainly for medical reasons, in a rented house are medical expenses.