More often than not, patients with 'heartburn' who present to me at my outpatient clinic or in ER are really having non cardiac problems. Commonest are certainly pain from GERD [ gastroesophageal reflux ie commonly called by laymen as 'gastric']. Often time pain due to gallbladder inflammation and impacted gallstones also can mimic 'heart pain' of angina.
A good clinician who listen well to the history given by the patient and after a careful physical examination, can usually deduce whether the pain is in the 1st instance cardiac or non cardiac. A stress ECG is usually done in most cases to separate the 'cardiac' from the 'non cardiac'. If stress ECG is normal and if I feel the problem is one of GERD, a referral to a gastroentologist would be done with a view towards upper GIT endoscopy, a procedure that can be done in the morning in a daycare outpatient gastro unit.
If I suspect that the patient's problem is due to gallbladder stone impaction in the cystic duct, I would ask for an ultrasound abdomen. This is a painless outpatient procedure done usually by radiologist [ Xray specialist ] similar to ultrasound examination done in pregnancy except that in this case the area under study is the upper abdomen.
Below are utube presentation of a laparascopic cholecystectomy [ keyhole surgery for gallbladder removal ], and upper GIT endoscopy.
For actual procedure,
Upper GIT endoscopy,