Federal law, (ii) a qualified long-term care insurance contract (as defined in section 7702B(b)), (iii) a health plan during any period in which the individual is receiving unemployment compensation under any Federal or State law, (iv) a high deductible health plan, or (v) any health insurance under title XVIII of the Social Security Act, other than a Medicare supplemental policy (as defined in section 1882 of such Act). . (b) Effective date The amendment made by this section shall apply with respect to insurance purchased after the date of the enactment of this Act in taxable years beginning after December 31, 2017. 228. Special rule for certain medical expenses incurred before establishment of account (a) In general Paragraph (2) of section 223(d), as amended by this Act, is amended by adding at the end the following new subparagraph: (D) Certain medical expenses incurred before establishment of account treated as qualified An expense shall not fail to be treated as a qualified medical expense solely because such expense was incurred before the establishment of the health savings account if such expense was incurred— (i) during either— (I) the taxable year in which the health savings account was established, or (II) the preceding taxable year in the case of a health savings account established after the taxable year in which such expense was incurred but before the time prescribed by law for filing the return for such taxable year (not including extensions thereof), and (ii) for medical care of an individual during a period that such individual was covered by a high deductible health plan and met the requirements of subsection (c)(1)(A)(ii) (after application of subsection (c)(1)(B)). . (b) Effective date The amendment made by this section shall apply to taxable years beginning after December 31, 2017. 229. Preventive care prescription drug clarification (a) Clarify use of drugs in preventive care Subparagraph (C) of section 223(c)(2) is amended by adding at the end the following: Preventive care shall include