You are being treated for heartburn or hiatal hernia, and you feel sudden chest or stomach pain, have difficulty swallowing, are vomiting, or are unable to have a bowel movement or pass gas; you may have a hernia that has become obstructed or strangulated, which are emergencies.
One strong possibility for your symptom is gall bladder stones and cholesterol deposits within the gall bladder which can cause sharp pain. Getting an ultrasound of the upper abdomen done in a walk in clinic or the ER will confirm the diagnosis.
Numerous conditions can cause pain in the right upper abdomen. According to the Merck Manuals Online Medical Library, pain that manifests in the abdomen, including the right upper abdominal quadrant, can be caused by the viscera or abdominal organs, structures outside the abdomen or the parietal peritoneum -- the membrane that lines the abdominal wall.