|
Rank: Member
Joined: 3/14/2018 Posts: 10
|
Hi folks.
I am loading an 837 document, and making a copy of it for an export file (EDI -> EDI) I need to update specific information during this copy (prices mainly).
I have a SQL view that has all the information I need, MRN, Visit and LX# to locate the specific charge line.
My question, how should the SQL view and EDI document be linked so I can properly update each price as it is written to the export document?
I was working on the assumption I could use the current MRN/Visit/LX and get the related information in the view, and insert the new value instead of the existing one. That has not been the case.
Steve.Ela attached the following image(s):
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
You certainly should be able to do what you describe. You use a SQL-WHERE or a regular filter to get some value from the database based on some lookup related to the data in the source segment.
Obviously you haven't given us any specific examples so we can't tell you what to connect, or where. It might be best for you to attach your actual files here, or screenshots which make it clear what you need to do, or open a case with Altova Support if you can't post those things in a public forum.
|
|
Rank: Member
Joined: 3/14/2018 Posts: 10
|
When MapForce is writing from the source document to the destination document, is it a line by line, with the looping? If it is a straight bulk copy of data, then it would not work to intercept specific lines.
|
|
Rank: Member
Joined: 3/14/2018 Posts: 10
|
OK, I am getting close. I am using the SQL Where object to limit down to the exact field I need. However, if there is no value in the table for that line, I need to pass the existing value from the document.
I was going to use an If/Else, but I am not certain how to determine the number of results returned from the SQL Where object.
Is that possible?
|
|
Rank: Advanced Member
Joined: 6/16/2006 Posts: 487 Location: AT
|
Steve.Ela wrote:OK, I am getting close. I am using the SQL Where object to limit down to the exact field I need. However, if there is no value in the table for that line, I need to pass the existing value from the document.
I was going to use an If/Else, but I am not certain how to determine the number of results returned from the SQL Where object.
Is that possible?
Maybe you just need to use the "substitute-missing" component after your SQL-Where component. If the query returned nothing, it will use the replacement value.
|
|
Rank: Member
Joined: 3/14/2018 Posts: 10
|
I have data from the original document coming into the SQL Where, and if it matches, I am getting the result. When I tried the Substitute, I got the following error.
ERROR G702: Algorithm construction: Internal error: Invalid cast generated.
I assume the If/Else is expecting a simple True/False for the bool. Steve.Ela attached the following image(s):
|
|
Rank: Advanced Member
Joined: 6/16/2006 Posts: 487 Location: AT
|
I wrote "substitute-missing", not "substitute-missing-with-xsi-nil". You use that component *instead* of the if-else.
|
|
Rank: Member
Joined: 3/14/2018 Posts: 10
|
I see. I was under Node Functions, not Sequence Functions. Will try that.
|
|
guest |