Complex Record Map with no Leading Data in body records
The Complex Recordmapper specify a map for headers, body, and trailers, but it expects all three to have fixed Leading Data to identify the record type. But what if the Header and Trailer have Leading Data, but not the body records? I can't seem to find a way to do this. For example:
HEADER|194|2012|Fall|20
12345|Adams|John|Michael|2|john.michael.adams@example.com|617-999-9999
12347|Jones|Robert|Alfred|1|bobby.jones@example.com|
TRAILER|8|100
Ideas?
Product version: IRIS 2021.2
$ZV: IRIS for Windows (x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:39:22 EDT [Health:3.3.0]
I have tackled a challenge like this - with additional complex wrinkles where the related records were all in separate files in one big zip-file pulled down via SFTP by my production Service and I needed to generate a combined file for the Complex Record Map to process with the appropriate prefixes in place.
I hope this will be useful to you - after getting it working, the vendor I had to write it for went belly up so I didn't finish cleaning up my traces or comments but this was fully working. The general flow is an SFTP pickup of a zip file daily that contains 4 files... a PAT (patient) file, a data element 1, data element 2 and data element 3 file - all comma separated. the Patient Identifier in the first file could link to the other 3 files in one of the columns.
At the end, I up with a single file I pushed into CRM that looks like (where PAT ID is 123456):
PAT|123456,SMITH,JOHN,M,moredata,etc
DATA1|49492,123456,data1data,data1moredata,data1etc
DATA2|577545,123456,data1data,data1moredata,data1etc
DATA3|454543,123456,data1data,data1moredata,data1etc
I hope it's useful to you to at least get an idea of how to get started on your particular use case. Happy to try and clarify anything if needed.
This looks like a job for a regular record map with a batch class rather than a complex record map ...