Forum Replies Created
-
AuthorReplies
-
Alright, that make sense. That is helpful, and I agree I think I should be careful about not routing unwanted things.
EPIC said the first part of the MSH9 is the actual trigger, and the second part is the message structure/format I believe. So that means I would essentially want to look at the first part. Does that sound right? Like you said below with ADT_A01.*
Keith,
In your example of the SIU messages, would I just route that as an S12, and essentially ignore the ADT_A01 at the end?
Thank you,
Jon
Jim,
I tried single and I still only get the first line and the rest are cut off. I can’t seem to get PWIM to see the (CR) as a reason to move down to the next line, even when I put x0D as the global termination on the VRL config.
Any other thoughts I could try?
Thank you,
Jon
Perfect. This all helps me see the things I’ve missed. All have been useful for me to figure this out. I appreciate the help thus far from everyone.
I do have it now storing into a list and if I add multiple outputs to the xlate like James recommended, I can then grab each one individually by calling the variable I’ve saved them into.
I’m still not able to retrieve them by list index, so if I enter something like this, with the next index:
set item [lindex $xlateInVals 1]
set xlateOutVals $item
I get a blank. So it’s clearly still thinking it’s in one field it appears. Which reflects what James said. Right now if I know how many to expect inbound it wouldn’t be an issue because I can just create that many variables in my output on my COPY statement and build it from there. So it still seems like even when I’m placing the list into one output variable, I’m not able to grab them by index, but maybe that’s not even the correct way to approach this.
Essentially my initial thought was to put the whole list into one variable. Check it’s length, knowing how many values there are, and then grab them individually out of the list as I build the PR1 segment. It seems I can do this if I assign a output variable in my COPY to each, but how could I dynamically build the variables in the output COPY field for a varying number? Or rather, should I use hardcoded values in the output COPY, up to a max number (i.e. 5) and just check if they are empty afterward?
Thank you again.
Thanks everyone. I was able to get this to function. In production they will be sending valid messages, not sure why they sent me these to test with and said they didn’t have any other option for testing.
I was thinking a screenshot might help explain my file read and output. When I do it without an XLATE in the route I get the same input file on the output structured the same as the input file. When I put it through an XLATE I get what I showed above, just the MSH and nothing else. Here are my inbound/outbound configurations.
Jim,
Thanks for the response. As I mentioned, I have very little X12 experience so bear with me. No I am not stripping the ISA off. In the testing tool on the X12 tab when I run the file it notices the envelope and I’m able to see all the data from the raw message, but you are saying I still need to strip it off?
Part of the problem will be I need to edit part of the header, and export the same X12 (with the modified headed) out to a new .835 file, so I’m assuming you’re saying that’s best done in TCL probably?
Also, there isn’t a way to just use an XLATE and copy from X12 to a VRL, or another X12, or there is I just need to run it, without using the testing tool? And it won’t work with the header?
Thank you,
Jon
Couldn’t agree more it beats driving to the office.
Thanks everyone, just wanted to see if I was the only one having issues. My company is slowing removing VPN access, so the only option I have is Citrix RDP to my primary workstation. I’ll explore the possibility of having the application published directly and see if that makes a difference.
Thank you.
Jim, It is just simply PID15, already in the variant.
I used the definition tree to make sure I didn’t mistype anything. I’ve attached a screenshot, hopefully you can see something I am just overlooking.
Thank you,
Jon
Jim,
I plan on spending some time this afternoon and taking a look. Good idea 🙂
Charlie,
I am doing it inside of an XLATE yes. Maybe I was trying to over simplify it. Using the screenshot I provided before I essentially need to strip off the top 3 lines of the file, and process any line after that, but in the middle header line that I strip, I need to grab that date and reuse it for every tab separated VRL message I send outbound.
I’ve included a screenshot of the simple XLATE I was trying to use. It does obtain the date when it strips the 2nd header line, but it’s gone when it processes any other line.
I’ve also included a screenshot of the echo statements. I set it to echo at the first copy statement (which is below the suppress in the other screenshot) and you can see it echos out when I capture it in the 2nd header, and never again, like it was reset or blanked. I don’t think I can do what I am trying to do without another step, such as the recommended HRL, I was just thinking maybe someone knew a quick and easy solution.
Thank you,
Jon
Charlie,
I read in a line at a time from the inbound file, so I thought it was a separate instance each time. When I echo the variable it only shows up for the new line coming in that the date is present, otherwise it is blank for the remaining lines in the inbound file, when I try to send it to the outbound VRL.
So when I encounter that piece in the header, it’s visible, any line after that it’s blank. I am not assigning @null to the variable afterward so I assumed it was a separate instance.
Thank you,
jon
Thank you both for the responses.
Jim,
To answer your question, the outbound is just tab separated VRL that takes data from the inbound and places it in the correct locations to be consumed by the destination system. Nothing fancy at all, just a line at a time writing to a tab separated file, 1 to 1, so one output for each input (after the headers) I can try the HRL, but I’ve never worked with them before.
Charlie,
To answer your question, it is global to the XLATE yes, but each time a line comes in from the source file, it starts the XLATE process over, since I’ve obtained the date in a previous new line from the source, it doesn’t seem to carry over to the next lines, as in the variable is empty after I’ve grabbed it from the header and moved on to the next file line. It is available for all subsequent statements during the time i’m working with the header line item, and not after the next line comes in from the file.
In your example, how would I be able to {set date } when that variable appears to be blank when the next line comes in? Maybe I’m not understanding.
Thank you,
Jon
Thank you both. I ended up changing the delimiter to a pipe and it seemed to solve my issues. When I get more time I’ll try your approach too Peter.
Slightly off topic, have either of you had a problem deleting a Database Schema (through Config in Site Options)? I created on an additional one by mistaken and just want to clean things up, when I go to the config screen and delete it, it disappears from the drop down, but when I come back, it’s there again?
Thoughts?
Thank you again.
That was it. Thanks a lot. It was throwing me for a loop as I was thinking based on how it reacted with other test scenarios that it wasn’t that so I didn’t even think to check it. Either way, that’s what I was looking for, thanks for the quick reply and another set of eyes.
Charlie,
I believe I have figured out a solution. You’ve been a huge help and I appreciate the assistance. I will keep everyone updated on the progress.
Thank you everyone for your advice.
Thank you,
Jon
Charlie,
My apologies if you thought I didn’t read your last post. I did in fact read it I was just trying alternative ways of finding my solution when I couldn’t get it working. I did try the $inp without the split and it doesn’t return any data (I believe because the inbound unformatted text), and I have been returning dispList after the loop at the end every time. Where in the previous code are you saying I should place this inside of the for loop?
set nmg [msgcopy $mh]
msgset $nmh $rec
lappend dispList “CONTINUE $nmh”
Within the vrlBuf loop or outside of that? I’d still need the previous code to help split after the : and add to the buff. Does this look like what you are suggesting?
Code:
proc create_formatted_file2 { args } {
keylget args MODE mode ;# Fetch modeset dispList {} ;# Nothing to return
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mhset vrlBuf “”
set dispList [list “KILL $mh”]
set inp [msgget $mh]foreach rec $inp {
# Make sure no leading lagging spaces
set rec [string trim $rec]# Each set of ***** add previous, if there, to buffer
if {[regexp — {^*} $rec]} {# Store buffer if exists
if {[info exists vrl]} { lappend vrlBuf [join $vrl |] }set nmh [msgcopy $mh]
msgset $nmh $rec
lappend dispList “CONTINUE $nmh”# Create or clear record buffer then ignore line
set vrl “”
continue} elseif {![info exists vrl]} {
# Ignore all before first set of records
continue
}# No blank lines
if {$rec eq “”} {continue}# Split each record and store into array
lappend vrl [string trim [lindex [split $rec :] 1]]}
[color=orange] return $dispList[/color]
}
shutdown {
# new mode
}default {
error “Unknown mode ‘$mode’ in create_formatted_file2”
}
}#return $dispList
}This is the result I get
CONTINUE: ‘***************************************************************’
CONTINUE: ‘***************************************************************’
CONTINUE: ‘***************************************************************
Ultimately If I use vrlBuf rather than rec in that loop I get closer to what I need it just comes in one large list again separated by { } { } which is fine but I need them on separate lines if I am to use them correctly.
Thank you again,
Jon
-
AuthorReplies