Prescription medication

If I take a medication I was prescribed at 4 weeks pregnant, will I get in trouble if they test meconium? Im 30 weeks. I havent slept in 5 days, my doctor wont prescribe me anything now, I have grand mal seizures from sleep deprivation and I'm home alone most of the time. The last seizure I had, my heart stopped. I'm scared to stay awake much longer. It's a medication to help me sleep. It's considered a hypnotic/sedative.