IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Load original, copy to new object, update specific information Options · View
Steve.Ela
Posted: Thursday, May 17, 2018 5:16:57 PM
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):
2018-05-18_11-07-55.jpg

K101
Posted: Friday, May 18, 2018 8:40:32 AM
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.
Steve.Ela
Posted: Friday, May 18, 2018 3:34:14 PM
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.
Steve.Ela
Posted: Friday, May 18, 2018 6:58:19 PM
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?
that
Posted: Tuesday, May 22, 2018 1:13:57 PM
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.
Steve.Ela
Posted: Tuesday, May 22, 2018 7:56:57 PM
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):
2018-05-22_16-17-29.jpg

that
Posted: Wednesday, May 23, 2018 10:20:26 AM
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.
Steve.Ela
Posted: Wednesday, May 23, 2018 1:54:55 PM
Rank: Member

Joined: 3/14/2018
Posts: 10
I see. I was under Node Functions, not Sequence Functions. Will try that.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.