The singer meets a young man/woman wrapped in flannel. The young person says that he/she is dying, originally of syphilis but in some versions of wounds or unspecified disease. The young person requests an elaborate military funeral.
Syphilis first appeared in Europe in epidemic form, with devastating effects, in the early 1500s. It was often treated with compounds of mercury, mentioned in some versions of the song.
Clearly this is the ancestral ballad to "The Bad Girl's Lament", "St. James Infirmary", "The Whore's Lament", "Streets of Laredo", "The Dying Marine", etc. -PJS
Silber & Silber subtitle their text "St. James Hospital," since the name is mentioned in the text. This title, however, seems to be associated primarily with the "Bad Girl's Lament."
At least a few versions refer to dosing syphillis with "arsenic and salts of white mercury." Mercury as a cure is older, as Paul notes, and arsenic was also used in various medicines during the nineteenth century and earlier. But arsenic as a true remedy for syphillis came into use in 1909, when Paul Ehrlich found arsphenamine to be effective; it remained in use until the coming of penicillin (see John Emsley, _Nature's Building Blocks_, p. 42).
The use of the "corrosive sublimate" of mercury (i.e. HgCl2) as a treatment for syphillis goes back to the late fifteenth century, though even then it was known that the cure was nearly as bad as the disease (see John Emsley, _Nature's Building Blocks_, pp. 255-256). Henry VIII and Robert Burns are among those found to have had high levels of mercury in their bodies at the time of their death, possibly due to treatments for venereal disease (Emsley, p. 257). - RBW