That is perfectly legal. The prohibition against illegal searches and seizures applies to police or law enforcement action--not to the action of non-law enforcement. So if you are unconscious, the ER will properly and legally search your clothing: for your ID, for clues to your condition (e.g. pill bottles), and for valuables which they must safeguard. If they find illegal drugs, they can call the police; the police and prosecutors may rely on the drugs in arresting and charging you, because they--the law enforcement authorities--did nothing wrong: it wasn't the police who searched you, but rather non-police, properly looking in your clothing, brought the drugs to your attention.