One of the NuPIC encoders is called MultiEncoder. I think that is exactly what it does (flattens the multiple fields into one input).