How to create a blank or empty message object #6305
Replies: 2 comments
-
I think you're going to have to more clearly define what you consider an empty message. Unless your data type is set to Raw or JSON (and I think you're using edi/x12 based on the variables names) then |
Beta Was this translation helpful? Give feedback.
-
Tony, Thanks for offering advice. I was able to accomplish what I needed with a very simple ...
My code parses 837 files and breaks them down to individual claims. I do that by looping through all of the segments and when I reach an end of claim condition, I reinitialize the different parts to what I was calling an "empty message". After appending to each of the objects above, I would ultimately take the accumulated XML and do the following to render 837 strings ...
Sort of my own crazy logic ... but has held up over time and just needed to figure out a way to create the "empty message" because the payload sizes kept growing and my old method of copying the messages and deleting all the segments was taking too long. Cheers. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Struggling with something that seems it should be simple, but proving to be elusive. In the code below, the msgPayload is the msg object being passed into the function. I'm trying to create an empty version of it so that I can have a blank message object of same type as incoming msg object. What I'm struggling with is that the only way I can get a empty version is to make a copy of msgPayload via the .copy() method and then delete all children of it. This works just fine on reasonable size files, but can be really slow when working with a larger file. Are there simple ways of creating the empty object so that I can use methods like .copy(), appendChild(), etc ...
Thanks in advance.
Chuck
Beta Was this translation helpful? Give feedback.
All reactions