You mention medications (specifically pain) which can effect sleep. I don't know enough of your medical history to make an educated comment. See your primary physician, if necessary get a referral to a specialist.
Being told you're delusional does not necessarily mean you're mental.