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
Cloverleaf
Add a Field Seperator
Collin Praster
Hello, I might be overthinking this.
My Practice Management is sending over a first and last name no seperators.
My EHR wants it LastName^FirstName
How can I accomplish this in an xlate?
Find more posts tagged with
Clovertech
Comments
Paul Bishop
I would do it using a tcl code snippit on a copy command. Source would be your field that has the full name, destination would be the name sub-fields (PID-5.0 and PID-5.1).
lassign $xlateInvals in_name
# assuming "<firstname> <lastname>"
# pull out last name
set out_pid_5_0 [lindex $in_name end]
# pull out first name - everything except last position
set out_pid_5_1 [lrange $in_name 0 end-1]
set xlateOutVals [list $out_pid_5_0 $out_pid_5_1]
you could get more fancy by checking the list length and pulling out the middle name separately. Of course, the ideal fix would be to have the source send it to you properly but we all know that isn't always feasible.
for some reason the last line isn't displaying correctly. you set "xlateOutVals" to a list of both out variables in the order they are in the Destination field.
System
Originally posted by Former Clovertech member
in its simplest form, I would probably add a Pre Proc something like this:
lassign $xlateInVals name_first name_last
set xlateOutVals [ list $name_last $name_first ]
...where the Destination fields are PID:5.1, PID:5.2
of coarse, if they send name_first name_mi name_last on occasion, it will get a little more complicated.
Charlie Bursell
What separates last name from first name?
Collin Praster
Its just a free text field so there is no separators
Jim Kosloskey
Therein lies a big problem. There is probably a space between first and last name so you could split on space but what if the last name was something like 'De Jesus'?
A name like 'Ronaldo De Jesus' would produce 3 elements from a split and you may only be planning for 2 so you would get First = Ronaldo, Last = De.
While it may be an issue for the sending system to place the name components properly in the HL/7 field, it may be easier if you ask them to separate the names with a comma then you split on comma.
Then something like 'Ronaldo, De Jesus' could be split on comma and result in what you want (you might have a leading or trailing space in one of the fields depending on formatting). That should work fine with non-prefixed last names as well.
If there can be middle names or initials, using a comma and insisting it be present even for a missing middle will also work.
In that case it may be likely the STRING Action Split function will be all you need.
Charlie Bursell
Post examples of IB field
Collin Praster
GT1|1|2393979|Testing^Vmc98|Parents Name|
Charlie Bursell
Is there always a space between last first? Even with that, as Jim said, what if space in last name? Tell your vendor sending the data that you must have a method to parse the name. Point out to them they are in line with the HL7 spec which defines last, first, middle in separate subfields.
Collin Praster
Hi Paul
I am still using cloverleaf 5.8, those tcl commands dont work, is there something similar in an older version of TCL?
Charlie Bursell
Did you resolve this?
Collin Praster
Sorry For the late response yes I have resolved this.