A number of hospitals had indoor water closets of some sort. They night have a rudimentary flush mechanism activated by pulling the chain to a cistern. The water carried the waste directly into a sewer, but there was nothing to keep noxious odors and gases from coming back up into the water closet. A hospital in Central Park in New York City had water closets on all the floors, but the building was so tall that the pressure was insufficient to get water for flushing to the upper floors.
Some hospitals had toilets that had to be flushed by using a bucket of water. Since that water usually had to be hauled from a distance, the facilities were not flushed as often as they should have been. Another variety, especially popular in Philadelphia hospitals, was a long, slightly slanted zinc trough. The trough had a cover with a number of seat holes. At the upper end was a faucet that could be turned on to flush the waste down a sewer hole at the other end. Ideally the water was always on to keep the trough clean, but, practically, this used too much water, so waste and odor accumulated between periodic flushes.
An indoor latrine did little good if the soldiers did not know how to use it. the patients at the Gordon Hospital in Nashville, Tennessee, in November 1861 used the water closets like a trash can, throwing in paper, sticks, cloth, and other rubbish. Not surprisingly, the drainpipes plugged up and filthy sewage overflowed the hospital to such an extent that the patients had to be moved out and the hospital closet and thoroughly cleaned.
The efforts of the U.S. Sanitary Commission in the Union army, as well as medical inspectors, surgeons, and army officers on both sides, led to considerable improvement in sanitation as the war progressed. It was evident that well-disciplined regiments, with properly prepared and used latrines, had much less sickness than unsanitary regiments.
From: The Encyclopedia of Civil War Medicine