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
Editing a Free Text Field
Jared Miller
Hello Clovertechers,
I am looking for a little help here in editing a free text field. Below is a sample OBR segment with OBR-13 (in red) being field I'm working with. What I am trying to do is remove everything prior to the semi-colon and pass everything after the semi colon on to the receiving system. So I'm trying to turn "Jump up and down ; Cysto-Grafin, 25 ml" into "Cysto-Grafin, 25 ml"
OBR|1|806963201^HNAM_ORDERID||7000010^CT Abdomen w Cont 74160|CT||20150220140122|20150220140131|||||Jump up and down ; Cysto-Grafin, 25 ml||&Rad Type|RADDOC^Raddoc^Test^A^^Test Radiologist||||CT15000013||20150220140137||CT|||1^^0^20150220135700^^N^Jump up and down||||
I am using an Xlate for this interface and have tried a few things myself from researching other threads but can't quite get the result I'm needing.
Thanks for any assistance you can provide!
Find more posts tagged with
Clovertech
Comments
Kevin Crist
can you split the field on the ;
something like below
lassign $xlateInVals obr_13
set field [lindex [split $obr_13 ";"] 1]
set xlateOutVals $field
warning: i am no tcl expert and going off a similar example that we have.
Charlie Bursell
Please don't do "set xlateOutVals $field
" Since there are spaces in the data you will get undesired results. Instead use: "set xlateOutVals
"You may also be able to do something like:# Assume you pass OBR.13set inp [lindex $xlateInVals 0]set outp ""regexp -- {^.*?s*?;s*(.*$)} $inp {} outpset xlateOutsVals
System
Originally posted by Mark Thompson
Jared,
Regular expressions are a worthwhile learning experience. If you prefer to delay that joy, you could try something like:
lassign $xlateInVals inp
lassign [split $inp ;] discard outp
set oupt [string trim $outp]
set xlateOutVals
The important thing to remember is that xlateInVals and xlateOutVals are lists not strings. Often that doesn't matter until you hit a test case (or production data) containing a space character.
Jared Miller
Thanks guys! I had gotten to the point of Kevin's suggestion (so clearly I'm no tcl expert either) prior to coming for help. I am getting the result I'm looking for now after reviewing Charlie and Mark's posts.
Before I was only getting "Cysto-Grafin," so the 25 ml was getting cut off. Now I'm getting all the data needed, "Cysto-Grafin, 25 ml"