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
how discard OBR when no OBX after
Mahmoud Ihaddadene
Good day,
We are receiving lab results OUL^R21 (2.4) see example below and send them to another system ORU^R01 (2.3). Some OBR doesn
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Moe,
If you don't want OBX segments on the outbound then just don't build them.
Unless you are using BULKCOPY - then they have already been built and you need to Null them out by ITERATING over the group appropriately and PATHCOPY
@null
to the appropriate Group Level.
Charlie Bursell
Jim:
Senior moment
I think he wants to ignore OBR segments without following OBX.
Two ways, Tcl or Xlate
In Xlate just make the OBR optional and do no copy it if no following OBX.
In Tcl, something like ( Gets a bit convoluted to keep track of locations)
Assumes HL7 has been split already
# Location of all OBR segments
set locList [lsearch -all -regexp $segList {^OBR}]
while {$locList ne ""} {
set loc [lvarpop locList] ;# Get OBR location
set nxt [expr $loc +1] ;# Location of following segment
#echo loc [lindex $segList $loc]
#echo nxt [lindex $segList $nxt]
# If next segment not OBX
if {![regexp -- {^OBX} [lindex $segList $nxt]]} {
lvarpop segList $loc ;# Remove OBR
# Decrement each following OBR location
set cnt 0
foreach num $locList {
incr num -1
set locList [lreplace $locList $cnt $cnt $num]
incr cnt
}
}
}
msgset $mh [join $segList r]
As I said, a bit convoluted. Maybe Xlate best option
Jim Kosloskey
Well that makes more sense.
Xlate already in place it appears.
So while Iterating on the OBR Group first check an OBX field (of the first OBX Group repetition) which is always there if the OBX is present (maybe the Set ID?).
If that is eq
@null
, then just don't build the OBR - and as Charlie said make sure the OBR group is optional on the outbound variant.
If, on the other hand you are using BULKCOPY, then you will need to ITERATE through the OBR group and if the same condition is true, PATHCOPY
@null
to the OBX group as well as the OBR to remove what has already been built. Luckily the Xlate 'shrinks' what is left to cover up any 'holes'.