Whether a hospital can swipe a credit card depends on the hospital's regulations and whether the POS machine supports it when collecting payment. Different hospitals have different requirements for payment and collection.
If the POS machine provided by the hospital is marked with the UnionPay logo, you can swipe your credit card. Banks generally do not impose restrictions on the types of credit card merchants, especially in places where hospitals have relatively large cash flows.
When registering at the hospital, because the transaction amount is relatively small at the hospital's payment window, users can only pay in cash and cannot swipe cards. Of course, credit cards cannot be swiped.