The way he read the line, it seemed like the number is what told him the Hiawatha was a medical frigate, but gave him no other useful information (or else he probably would've said, "NCC-dash-815... oh, the Hiawatha. A medical frigate"). If he'd memorized the number of every ship specifically, he'd have recalled more. Could be he recognized what remained of the hull shape, and combined that with the number to made an additional deduction. Like if you saw the front-half of the Saratoga, you might figure "Oh, 31900 block with a refit-Constitution saucer? Must be Miranda-class". So maybe all the NCC-81X ships of that class were converted to hospital ships, and the NCC-80X Hiawatha-types were troop carriers or bulk freighters or something.