Code 7 is correct.
When you enter the Form 1099-R and you were age 70½ or over in 2023, 2023 TurboTax online will ask, "Do any of these situations apply?" One of the checkboxes will be to indicate that you had money transferred directly to charity. After marking this checkbox, TurboTax will ask you to enter the total amount that was transferred to charity. TurboTax will include the enter on Form 1040 line 4a the total gross distribution but will exclude from line 4b with the QCD notation the amount that you indicate was transferred to charity.