Is it illegal to have discarded mattresses stacked in the open in hospitals?

Lawful.

The legal representative of the medical institution is the first person responsible for the classification and management of waste in the medical institution, and the specific departments and operators who generate waste are directly responsible. In accordance with the "Medical Waste Classification Catalog" and other requirements to develop a specific list of classification and collection, classification and collection of infectious waste, pathological waste, injurious waste, pharmaceutical waste and chemical waste. Infectious waste, pathological waste, injurious waste should be sent to the medical waste disposal unit for disposal, and pharmaceutical waste and chemical waste should be sent to the relevant industrial hazardous waste disposal unit for disposal.