-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing into the database but.. #16
Comments
Yes there is. I have done it with Excel VBA. |
What I'm trying to accomplish is importing the data into a SQL database and later recreating the same 837 x12 file by exporting it. I will have to double check but I thought I also wasn't able to successfully import into my SQL database that I was testing with. |
Yes, once you get it into the DB, you can extract specific X12 claims by using a transaction number that ties the segments all together. I'd offer some example code if I knew what you were coding the extract application in. |
There were a few different applications I was trying to test but I think with this I didn't have success getting the claims into the database. I will try again in a couple of hours when I'm done around the house. With the extraction part are you able to do it based on file and not the transaction number? Thanks for your help as it's much appreciated! |
Hi, Meanwhile, good luck with the importing which should work almost magically if you have adequate rights to the DB. Cheers, |
It's my personal database so i have dba rights. I don't recall there being any specifications that can be added to the config file or does the server/database name info need to be added in the command line? |
Hi, Unfortunately I don't have the exact information for you right now but you need the Transaction Set ID from when you imported the file and then get the line terminator record with this: Then I write the records out line by line and add the terminator. I did this because the stored segments don't have the terminator. Good luck and let me know how you go. |
Was the stored procedure included with it? I don't believe I got any stored procedures with the zip file. I didn't see that. I will look around to see if I can find anything else. Thanks. |
If you use SELECT SEGMENT FROM GetTransactionSetSegments(3,1,1); |
That's helpful. I tested it and it pulled the one claim record I tested. What if I wanted to pull the whole claim file? What would I do to replace the first value in the (). Also have you ever added a segment? The additional segment I was going to add is a REF*LU which would go under the REF table. Is there a feature that will recalculate the values if you add a value? Thanks again for your help. |
Have you ever had to deal with a file that didnt have st/se lines per claim and instead just one st and one se for the complete file? Thx |
Regarding the addition of a REF segment, I've added segments manually and recalculated the line count value on the footer but not programmatically yet. As LU is situational, I'm curious as to how often would you need it? For the data with one ST/SE set, that just sounds like a set of claims for one provider. You can include or exclude the transaction set control lines with one of the parameters of the getTransactionSetSegments function when you recreate the file. You can also take segments from a file with one of the programs in the project. I only played with it once though and will have to take a look at it again. What system are you loading into? |
It's the UnbundleX12 package that lets you grab segments from a file. |
Database: MS SQL Server The ref segment would be added to every claim with regards to being either an identifier or an error message so in theory every claim record would have them. I was able to insert the segment but obviously the positioninchange and parentloopid are not correct as I'm just copying the values from the EI value. Are you recalculating the line value on both the individual claim record and the total file line count as well? With the file with only one ST/SE i wish it was for just one provider however it's not. It's actually for one trading partner and that's how they send the data. Basically 4k claims all in between one ST/SE. I wonder if there is a way to add the individual ST/SE piece to each claim record. |
I might have mistated on yesterday when I was asking about pulling a complete file. I would setup the process to pull one file at a time so the interchange value would always be the same techincally so pulling all the claims from that one file. Let me gather my thoughts a little after messing with that function and I will try to ask some better questions to see if you have some additional guidance. Thanks. |
I did by the way figure out how to extract the file using GetTransactionSetSegments successfully. |
Now, as you extract the data from the DB, add the new segment as you write the file, recalculate the line count and update the footer. And if you save it with the name you want, you have everything you need for now. |
With GetTransactionSetSegments the only issue I see and I'm not sure if I missed something but it's missing the ~ on each line. Not sure if I did something incorrectly or not. I tested 11 files and 10 seemed fine except they were all missing the ~ as mentioned above. On the 11th file very oddly it mixed up the segments somehow. The original started off like this: The recreated one is like this: Appears there is also an additional value in there somewhere. I'm not that worried about that though as I was able to get the other 10 to process fine for the most part. These are the parts I'm really stuck on:
Hopefully the name time you respond I will be around so I can respond back quicker as well. Thanks |
For #1 you have to either append a hard coded Terminator or retrieve the Terminator from the DB for the transaction set. I use this: I'll look at your other points shortly. |
Where do you place that in the function and does it matter? I didn't try it yet as I'm away from the PC at the moment. Once again thanks so much for looking at my questions. |
I just grab a record from the DB, append then Terminator, then write the file line by line. It's primitive right now but met my purpose. |
Actually, for #1 I create a recordset with the GetTransactionSetSegments function and add the terminator character to each record before saving it in a file. |
For #2, you could either copy the TransactionSet and add the new segments by inserting them into the TransactionSet Table with new "PositionInInterchange" values so that they are considered part of the TransactionSet, then generate your file from the new table. You will also have to add a ParentLoop value to the segments. Can you give me a masked example fo the REF*LU segment you want to add and the source of the information that goes into it? For #3, can you send a masked copy of the X12 file and a hard coded example of an expected result? I may be able to throw something helpful together to get you moving. |
Yep, sure thing. I will send you some samples later today. Thanks! |
Attached are the sample data.
|
Are you referring to the one labeled as example without ST/SE? I will keep messing around with them myself to see if I can come up with anything as well. What would really be helpful with the files which have multiple claims between a ST/SE segment would be if I could convert the file to having the ST/SE segments for each claim in the file. Thanks for your assistance. |
Hi @denissedonnelly, I have a question related to the database which you used to import the incoming SQL. Was it installed thru some tool or you created it manually? I have a scenario where I need to do data modeling of the X12 data into the database, so if you can share some information regarding it, that will be really helpful. |
@ngupta-bh , Hi there. Honestly I don't even have the information any longer and not even sure what I ended up doing off the top of my head. Since I needed this for the ability to parse a 837 (I, P, and D) into SQL server I ended up using https://github.com/MDMS17/837Parser which has an importer and exporter. I modified both with a little work to handle what I needed. Works like a charm and still using on a daily basis. |
When importing the x12 (837 for example) into the database is there the ability to export and recreate the x12 that was imported?
Thanks!
Denisse
The text was updated successfully, but these errors were encountered: