Thank you and this new version works well, and logging the error help me as well. I still not an expert to do this, but can edit a bit and read regular expression. Yes, I should have given the original message to start with but here is the full message.
Code: Select all
It is a HL7 message that I use to generate files that another program will use file I/O to read and generate fake orders for testing. The script is doing as it expected, and generate the files creating the file in sequential order. I guess my final question is that, can the script be made where will do the same file creation but replaced all string with A00001 and then with the incremented number?
Or could it be made where it will start with the segment PID and increment the number, or I can copy the same sub routine and add ORC, OBR, etc, so in the future, I can add more segments where it will look for that string and then just increment before it copy it into the new file?
Currently, it seems to changed the ORC segment and doesn't do all matches. If I could make it scalable where I can just add new segments in the future, it would make my life easier generated fake messages for testing.