Looks like your theory is correct. He must have been allowed to visit Vicksburg under a flag of truce to bring out patients to his hospital at Quitman. Believing he wouldn’t be searched, he was given the flag for safe passage through the lines. Probably hidden under the sheets of a patient.