Unfortunately, dirty water can be a killer so there is a possibility that it's too late to save the fish. With that in mind, you need to determine if the fish's scales have started to pinecone away from the body. If they have, that would be an advanced stage of dropsy and the odds of a successful recovery are extremely low.
If they aren't at that point, you need to treat the fish with an internal antibiotic because the fish most likely has an internal bacterial infection which may have infected the swim bladder. The proper medication will depend on your water's parameters, particularly pH. You should have the cleanest water possible in the hospital tank. (That means no ammonia, nitrite or nitrates. ) If the pH is above 7.2, the best internal antibiotic is Kanamycin ( seachem Kanaplex if you can't get plain kanamycin.) If your pH is under 6.8, the better internal meds would be Minocycline ( Maracyn 2) or Nitrofuracin Green. If your pH is between 6.8 & 7.2, use a combination of Nitrofuracin Green AND Kanamycin following the directions for each medication for water change schedules and dosing. This last combination is a highly effective antibiotic but as you can see, it has a very limited window of effectiveness so if your pH is not within the window, use only the one that works the best at your pH level.
Also, Epsom salt baths can be helpful but they need to done frequently if you are trying to get fluids out of the fish. Best is to add epsom salt to the hospital tank directly at a rate of 1 teaspoon per 5 gallons of actual water. This can be left for a week but if you need to do a water change before the 7 days are up, you will need to replenish the epsom salt ONLY for the amount of water being added back to the tank ( at that same rate as first applied.)
If you need help properly setting up a hospital tank, I laid it out in comment #2 in this thread:
Quarantine tanks and Hospital tanks, are they really different?
Hope this helps.