; ; and (2) in subparagraph (B)(iii), by adding at the end the following: (V) Expiration of authority The authority of a graduate medical school described in subclause (I) to qualify for participation in the loan programs under part D of title IV pursuant to this clause shall expire beginning on the first July 1 following the date of enactment of the Foreign Medical School Accountability Fairness Act of 2017 . . 4. Loss of eligibility If a graduate medical school loses eligibility to participate in the loan programs under part D of title IV of the Higher Education Act of 1965 ( 20 U.S.C. 1087a et seq.) due to the enactment of the amendments made by section 3, then a student enrolled at such graduate medical school on or before the date of enactment of this Act may, notwithstanding such loss of eligibility, continue to be eligible to receive a loan under such part D while attending such graduate medical school in which the student was enrolled upon the date of enactment of this Act, subject to the student continuing to meet all applicable requirements for satisfactory academic progress, until the earliest of— (1) withdrawal by the student from the graduate medical school; (2) completion of the program of study by the student at the graduate medical school; or (3) the fourth June 30 after such loss of eligibility.