Our COVID inpatient numbers remain low, roughly 4% of our total cases as of now.
The new project to be carried out over the next year and a half will include the addition of 30 elementary units, a third cath lab equipped to provide a higher level of care for patients with stroke symptoms, enhanced capacity to the NICU, and continued efforts to expand trauma services and robotics.
And with USPI, we've added more than 570 physicians joining our medical staffs during this quarter, bringing the number now that have joined to 1,100 year-to-date.
Florida remains a very important part of our portfolio as our five Palm Beach hospitals, which continue to grow and improve, coupled with more than 40 Florida ambulatory assets ensures a very strong, viable network in our continued -- in this continually growing area.
Strategically, the Miami transaction also continues the objective of diversifying our EBITDA further to our Ambulatory segment, which we project to be approximately 43% or so by the end of the year.
Our hospital portfolio is now positioned as the number one or two in 70% of our markets and with the Miami sale, that number will edge higher.
USPI has in-house, a very advanced service line and development team, and in the second quarter, for example, we added 25 new starts for service lines across the range of specialties bringing that total to 45 year-to-date.
Following a strong first quarter, we produced another very good quarter as we generated adjusted EBITDA in the quarter of $834 million which was $109 million better than the midpoint of our expectations.
Looking back to the second quarter of 2019, our consolidated adjusted EBITDA this quarter represents a compounded annual growth rate of about 12% and our adjusted EBITDA margin increased 170 basis points, excluding grants.
Substantially, all of our 20 hospital markets exceeded our expectations for the quarter, including 14 markets that exceeded our internal EBITDA forecast by more than 10%.
Our case mix index in the quarter was about 10% higher than the second quarter of 2019.
Our hospital adjusted EBITDA margin, excluding grants, was 10.9% in the second quarter, which was 50 basis points higher than in the first quarter of this year and 150 basis points higher than the margin we reported in the second quarter of 2019.
USPI generated EBITDA of $295 million in the quarter, which included $20 million of grant income.
USPI's EBITDA in the second quarter, excluding grants, represents a compounded annual growth rate of about 15% looking back to the second quarter of 2019.
Surgical volumes this quarter recovered to 100% of pre-pandemic levels, patient acuity, and revenue yield remained strong, and cost continue to be well managed.
USPI's EBITDA margin, excluding grants, of 41.4% was 190 basis points higher than the second quarter of 2019.
Also, we anticipate approximately 43% of our consolidated adjusted EBITDA in the second half of 2021 will be from our USPI business, demonstrating further progression toward our goal of approximately 50% by 2023.
Turning to our revenue cycle management business, Conifer generated $90 million of adjusted EBITDA and continue to deliver strong margins of 28.2%, which was 50 basis points higher than the first quarter.
We ended the quarter with about $2.2 billion of cash on hand and no borrowings outstanding on our $1.9 billion line of credit.
We generated $123 million of free cash flow in the quarter or about $275 million before the repayment of over $150 million of Medicare advances we received last year at the outset of the pandemic.
Year-to-date, we've produced $536 million of free cash flow or about $688 million before the Medicare advance repayments.
Our leverage ratio at the end of the second quarter was 4.17 times adjusted EBITDA and 4.86 times adjusted EBITDA minus NCI expense.
Also, we refinanced $1.4 billion of notes during the quarter, which will result in $13 million of future annual cash interest savings and we realized over $100 million of cash proceeds during the quarter from the sale of our urgent care centers, a medical office building, and some other property.
As you can see on the slide, we raised our guidance, $100 million after the first quarter due to our strong performance and grain income that we were able to recognize, which was not assumed in our original guidance.
The other item to call out is that we are assuming the sale of our Miami-area hospitals will be completed during the third quarter which will result in about $55 million of earnings being removed from our previous guidance.
Our adjusted EBITDA outlook for 2021 is now projected to be $3.200 billion at the midpoint, which is $200 million higher than our original outlook at the beginning of the year.
Since we are assuming that the sale of our Miami hospitals will occur on August 1st this year, we removed approximately $22 million of Miami EBITDA from our Q3 EBITDA outlook and approximately $167 million of revenue.
For the last five months of the year, we removed $55 million of EBITDA from our outlook due to the planned sale and we removed about $418 million of revenue from our outlook due to the planned sale.
And to reiterate, we've raised our full-year 2021 guidance for the second time this year with our full-year EBITDA midpoint now $200 million higher than the start of the year.
I want to point out that our updated outlook includes a pre-tax book gain of about $400 million for the anticipated sale of the Miami hospitals, but this gain is not -- it's not included in our adjusted EBITDA or adjusted earnings per share guidance.
As for cash flows for the year, at the midpoint, we anticipate generating free cash flow of about $1.275 billion and adjusted free cash flow of $1.400 billion this year at the midpoint before taking into consideration the repayments we anticipate making in 2021 of approximately $700 million for Medicare advances and the deferred payroll tax match.
Free cash flow for the year of $1.275 billion before the repayment of the advances and the taxes, less expected cash NCI payments of $470 million results in positive net cash flows of about $800 million this year.
Also, I wanted to mention our income tax payments for 2021 are anticipated to be approximately $150 million.
The increase in expected tax payments in the back half of the year is due in large part to the about $50 million of federal and state taxes related to the gain on sale of our Miami hospitals.
I do want to remind you that utilization, net operating loss carry-forwards for -- from the two most recent years are limited to 80% of taxable income for 2021 tax filing purposes.

Summary:
Our adjusted EBITDA outlook for 2021 is now projected to be $3.200 billion at the midpoint, which is $200 million higher than our original outlook at the beginning of the year.