Find the Cause.
Emergency rooms are ideal for one thing: emergencies.
They focus on "ruling out" problems that are potentially life-threatening. Primary care drs. Are best at providing the follow-up you need to get to the bottom of the cause of your pain, which may include testing not done in ers and/or specialist referral. I suggest you follow-up with the doctor/clinic that the er referred you to. Good luck!