You tell them and they give you appropriate medicine. When I was diagnosed with cancer I had to sit the doctor down and tell them I'd been using heroin the last 5 days in the hospital, since I didn't have enough supply for the 30-day stay I was looking at. They were actually really compassionate with giving me enough opiates. They obviously had to search my stuff and take the drugs I'd brought in but they got me settled on liquid oxycodone and IV dilaudid. At the other hospital I was at they didn't do the Dilaudid though, which sucked, but that just came down to each hospital's policies--they gave me approximately equal amounts of oxy (150+mg/day).