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
Xlate pre proc code?
System
Originally posted by Mark Perschbacher
Can anyone tell me why this code when used as a pre-proc in an xlate will work for everything but ~'s?
set code [lindex $xlateInVals 0]
set xlateOutVals [list [string map "~ { }" $code]]
Find more posts tagged with
Clovertech
Comments
emastascusa
If ~ is one of your HL7 delimiters,
echoing $code will probably show that the 0th element of your xlateInVals list is going to be everything to the left of the (first) '~'. The delmiiters will split your xlateInVals list and won't actually show up in the xlateInVals list elements.
The only way I know to remove unwanted delimiters is in a tps proc, not an xlt proc.
System
Originally posted by Mark Perschbacher
Ed, yes ~'s are the delimiter our lab system uses to indicate new line. So if I create a proc that is called within an xlate, should that work?
emastascusa
Mark,
If you know that you only have "~"s in the data at the front end of the copy you could do somthing like this inside the xlt proc. This fails if there are ^s or &s spiltting up the incoming list.
set outVal ""
foreach val $xlateInVals {
append outVal $val "~"
}
set outVal [ string trimright $outVal ~ ] ;# remove trailing s or ~s
set xlateOutVals [ list [string map "~ { }" $outVal ] ]
depending on what you are trying to do, a pre/post tps proc may be more straightforward - that's where we invariably do this sort of scrubbing when the data isn't quite HL7.
System
Originally posted by Mark Perschbacher
Ed, I went ahead and inserted it as an xlate CALL, and it worked. The only problem is since the ~'s are deliminters, when the xlate converts the proc output back to the outval, it still inserts the ~'s. I am thinking that running a similar proc on the thread after it is xlated might be the way to go. I am also testing another proc I pulled from Clovertech that truncates the OBX-5 if it is greater than 68 characters, but can't get it to work. The proc runs fine, it just doesn't truncate. Do you have time to take a look at it?