infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
Removing a }
Jared Miller
I'm using the following code to remove certain characters from the patient name field:
regsub -all {\|/|-|.|}} $xlateInVals "" xlateOutVals
Can someone help me with the code to remove a }? Thanks.
Find more posts tagged with
Clovertech
Comments
Charlie Bursell
You are making this more difficult than it needs to be. Use the string map command instead. This command accepts a list of pairs where the first character of a pair is the part to find and teh second is the replacement.
For example
set replList
set str "1\2/3-4.5}6"set newstr [string map $replList $str]echo $newstr123456In most cases the string map command is much faster plus you don't have to escape as much.
Jared Miller
Ok, here's what I interpreted that into and I'm getting a Tcl callout error so obviously I've gone wrong somewhere. Please assist me further. Thanks!
proc xlt_name {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set replList
set name $xlateInVals set newstr [string map $replList $name] }
Charlie Bursell
Boy, I don't know how many times to state that *ALL* xlate upvar variables except xlateId are *LISTS*
I can't tell, but I assume there are spaces between values in replList
Also, I guess we do need to escape the } to keep Tcl from getting confused
Works for me.
proc xlt_name {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set replList
set name [lindex $xlateInVals 0] set xlateOutVals [list [string map $replList $name] ] }
Jared Miller
That did the trick for me. Thanks for the assistance!
System
Originally posted by Joe Halbrook
I've tried this proc, and many variations of it, attempting to filter a single [ character (and I escaped the [ character) but the message content
System
Originally posted by Anonymous
Joe,
When you escaped the [ character, did you enclose it with curly braces?
hcitcl>set a "123[456"
hcitcl>echo $a
123[456
hcitcl>regsub -all {[} $a "" b
1
hcitcl>echo $b
123456
Thanks...
Tom Rioux
The Methodist Hospital
System
Originally posted by Joe Halbrook
Tom,
This is what I did:
proc xlt_rmvchars {} {
Charlie Bursell
This works for me. Give me you input string and what you are seeing for output
System
Originally posted by Joe Halbrook
Charlie,
Here's what's going in:
NTE|2|RADTEST3|THIS [ WAS MEANT TO } HAVE ERRORS IN IT
and here's what comes out:
NTE|2|RADTEST3|THIS
Charlie Bursell
That one character comes out to be the following in hex:
cee1cee9 cee1
I don't see this when I run it on my system. I think you have something else going on
System
Originally posted by Joe Halbrook
Thank you, Charlie, for taking a look at this.
I'll look into this in more detail to see if there's something else configured in this Xlate, and let you know what I find.
System
Originally posted by Joe Halbrook
The message leaves the sending system with a [ character in the NTE segment, but when it gets to the inbound Cloverleaf thread, it has a value of xe2 for that character.
Here's the message coming out of the sending system (all identifying data has been altered):
MSH
System
Originally posted by Michael Hertel
You get this message from an sna interface, don't you?
hci_e2a and hci_a2e don't have [ ] characters for translation.
You need to fix the translations.
-mh
System
Originally posted by Joe Halbrook
Yes, it is an SNA interface. Any suggestions?
System
Originally posted by Michael Hertel
It's a fairly complicated fix.
The EBCDIC/ASCII map tables are in a file named hciStart.tlib
Make sure if you touch this file that you back it up first.
You can really muck up your system if you make a mistake.
You should probably contact support.
Or maybe Charlie can explain what needs to be done.
System
Originally posted by Joe Halbrook
I think I'll tackle this from the other side, and ask that the system sending the offending characters edit those out prior to sending to Cloverleaf.
Thank you (and Charlie) for your insightful information, though.