I’m developing an interface that processes some input file (can be .csv, json, xml, or HL7) and creates a json object for each record. Inbound reads from local file directory, xlate runs, then outbound sends 1 record at a time via sFtp. The problem I’m running into is sending them a correctly formatted json for multiple records.
My output file looks like this:
{patient1 json}{patient2 json}{patient3 json}
But I need it to look like this:
[{patient1 json},{patient2 json},{patient3 json}]
Preference is to do this all in Cloverleaf.
One thought I have is to add another thread that writes to local disk after the xlate, have the sFTP thread pick up that file, and then have tcl format it before sending the file out…but I’m hoping to avoid doing this due to performance concerns down the road when we’re trying to process huge volumes of messages.
Is this the best way to do this in Cloverleaf or is there a better way that I’m missing? Hope I explained this well…thanks!