Triage is normally done before you get to the hospital.
One of the standard mass casualty measures used in the field at the scene of an incident is what is called "triage of patients."
Very basically, there on scene, people with injuries are classified into three categories:
Those needing treatment and for whom the outcome can be influenced by treatment are transported first to medical facilities.
At this point I'm going a bit beyond my "medical expertise," since hospitals also may do triage at their facility as patients arrive who have not been treated or triaged in the field. If you recall the Las Vegas concert shooting, people who were shot were being loaded into pickup trucks and taken directly to hospitals. And, in a widespread disaster you can expect patients to arrive at a hospital never having been seen by any medical professional in the field, like a paramedic.
This, though, is how the "normal system" should work. What I'm reading about lately is that some hospitals that are being overwhelmed by COVID-19 patients are starting to triage them while they are in the hospital receiving treatment. The general assumption is that once you have been admitted and are being treated, everything possible will be done to save your life. When needs exceed capabilities and there are patients who are not expected to be able to recover, then a difficult "triage decision" might have to be made about who you "make comfortable" and who you think has the ability to recover.
This is beyond the norm for how a hospital functions and a reflection of a medical crisis in a state or region that has the number of hospitalizations exceeding capabilities. I expect more medical facilities will be facing these types of decisions in the weeks ahead, especially in more rural areas of states with fewer medical capabilities.