https://www.acep.org/life-as-a-physician/ethics--legal/emtal...
Some hospitals voluntarily do more than the law requires to treat such patients.
So somebody with a serious medial condition could be discharged, but only once that condition was treated and unlikely to further deteriorate. And then there's also a bunch of other rules hospitals that accept medicare have to follow for all patients, which are similar in spirit to EMTALA. And then there are going to state rules on top of all of this. Violations are severe with penalties able to be imposed on both the hospital and the doctors/staff involved - up to and including loss of license, and they are not covered by malpractice insurance. And the courts have invariably ruled on the side of patients, so I don't think there's any doctor that's going to be looking to try to short-serve the requirements of the law. Part of the reason you can find a million negative articles about it!