reporting periods beginning on or after the date that is 1 year after the date of enactment of this paragraph, the following shall apply: (A) A critical access hospital may elect to be treated as a hospital or as a non-provider setting for purposes of counting resident time for indirect medical education costs and direct graduate medical education costs for the time spent by the resident in that setting under subsections (d)(5)(B) and (h), respectively, of section 1886. (B) Medical education costs shall not be considered reasonable costs of a critical access hospital for purposes of payment under paragraph (1), to the extent that the critical access hospital or another hospital receives payment for such costs for the time spent by the resident in that setting pursuant to subsection (d)(5)(B), subsection (h), or subsection (u) of section 1886. . (2) Sole community hospitals Section 1886(d)(5)(D) of the Social Security Act ( 42 U.S.C. 1395ww(d)(5)(D) ) is amended by adding at the end the following new clause: (vi) For cost reporting periods beginning on or after the date that is 1 year after the date of enactment of this paragraph, the hospital-specific payment amount determined under clause (i)(I) with respect to a sole community hospital shall not include medical education costs, to the extent that the sole community hospital receives payment for such costs for the time spent by the resident in that setting pursuant to subsection (u). . (c) Conforming amendments (1) Section 1886 of the Social Security Act ( 42 U.S.C. 1395ww ) is amended— (A) in subsection (d)(5)(B), in the matter preceding clause (i), by striking The Secretary and inserting Subject to subsection (u), the Secretary