Hi, I am an American Board Certified Neurologist with vast experience in diagnosing & treating all types of neurological & other medical conditions including the concerns of “New onset pain in the lower right rib cage area” you have mentioned here and I am very glad to help you with your health concerns.
I see you are having pain under/next to rib cage on the right side fir about 1-2weeks
You are also having cough for about 6+ weeks
And I see you cough hard and long some mornings and this indeed raises the possibility of pulling or straining muscle in the rib cage on the right side and this may explain the pain
The pain is more when you are breathing and moving etc which also implies this is most likely some kind of external musculoskeletal pain and this may be due to muscle injury in the rib cage due to hard and prolonged breathing
While this is the most likely explanation however since this pain is still persisting it is better to get this examined in the clinic. Also you may undergo some chest related investigations, like a chest x ray and any other investigations as necessary to explore any other possibilities. You have been coughing now for many weeks and this appears to be due to bronchitis but this attack appears more prolonged compared to your previous attacks so this also needs further investigated. You are also having change in color of the phlegm and this may imply infection of the respiratory tract/bronchitis and if you have not started any antibiotic then it is recommended now to consider starting an antibiotic too
It is better if you could see your doctor in the clinic so that you can receive a thorough clinical examination followed by a chest x ray, and any other investigations as necessary and this will help in ascertaining the cause for this persistent right lower rib cage area pain and also evaluation for the persistent cough and discoloured phlegm and then treated appropriately, however I once again reassure you the pain in the right lower rib cage area does not appear to be due to any serious problem and it is most likely related to pulling or straining muscle in the rib cage area due to hard and prolonged breathing, while this now needs to be investigated since this is persisting for few weeks already, but most likely this is not due to any serious underlying illnesses.
Please let me know if you have any further questions, and please click a positive rating (preferably 5 Star/Excellent) to credit for the time & effort put by me in answering your health question, and this is the only way I will be credited for my service to you. If you have follow-up or additional questions you can ask them after the rating too.