Your regular physician would be able to order lab tests for you to check the overall health status of your body and based on your results, he or she would be able to recommend you to a specialist if need be in regards to liver function and such.
A pain management physician works with all types of pain medication and understands how it works and how to deal with the adverse reactions. Those types of specialists as well as pharmacists would be able to determine which class of drugs you should avoid and what can be possible options to use for your upcoming surgery or in any event that calls for pain relief. They can sit down with you and talk to you. They would have to go over each medication, what type of reaction you had and how you felt on the medication. Based on that, they can determine which drugs can be options for you.
On a side note, all the drugs you have listed have one common agent and that is codeine. You may be intolerant to codeine and therefore any drug that has a derivative of it such as Vicodin, Percocet, morpine, etc you would not be able to take. Other classes of pain medication such as Tylenol, Motrin, meperidine, or fentanyl may be options for you.