Forum Replies Created
-
AuthorReplies
-
Thanks Jim!
October 26, 2010 at 6:55 pm in reply to: Taking 1 IB Result message and sending 3 OB messages #72929That worked perfectly. Since the split isn’t working correctly it still doesn’t add the zeros. It is interpreting the entire string.
result = ‘expected integer but got “229^LONG^CHAD^J”‘
So the %d will not work unless I get the second split of the sub_sep to work.
My output now looks like this after I changed the %d to %s:
018018229^TEST^CHAD^J
So it is closer but instead of the 018018229 it should be 01800229.
Tom,
When I inserted that code I got the following error:
Please Wait ……
Command Issued: hcitpstest -r run -f len10 -c sms_ib_data -e “hcitpstestshowbydisp ” /quovadx/qdx5.6/integrator/pod_prod_01/HCIDOCNUMISSUE “z_fixHmsToMcKesson.1.1 {HMSID 018} {MCKID A} {TOSYS HCI}”
Command output:
229^LONG^CHAD^J
[0:TEST] Tcl error:
msgId = message0
proc = ‘z_fixHmsToMcKesson.1.1’
args = ‘{HMSID 018} {MCKID A} {TOSYS HCI}’
result = ‘expected integer but got “229^LONG^CHAD^J”‘
errorInfo: ‘
expected integer but got “229^LONG^CHAD^J”
while executing
“format %05d $DocNumber_9_0”
(“PV1” arm line 50)
invoked from within
“switch -exact — $type {
MSH {
set msg_type_1 [lindex [split [lindex $fields 8] $sub_sep] 0]
…”
(“foreach” body line 4)
invoked from within
“foreach seg $msg {
set fields [split $seg |]
set type [csubstr $seg 0 3]
switch -exact — $type {
…”
(“run” arm line 33)
invoked from within
“switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
…”
(procedure “z_fixHmsToMcKesson.1.1” line 5)
invoked from within
“z_fixHmsToMcKesson.1.1 {MSGID message0} {CONTEXT sms_ib_data} {ARGS {{HMSID 018} {MCKID A} {TOSYS HCI}}} {MODE run} {VERSION 3.0}”‘
Here is what I have so far:
# Consulting Doc
set pv1_9 [lindex $fields 9]
set pv1_9_list [split [lindex $fields 9] $ssub_sep]
for { set i 0 } { $i < [llength $pv1_9_list] } { incr i } {
set DocNumber_9_0 [lindex $pv1_9_list $i]
echo $DocNumber_9_0
if {$DocNumber_9_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_9_0]
echo $nDocNum
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
echo $replaceDocNum
set pv1_9_list [lreplace $pv1_9_list $i $i $replaceDocNum]
}
}
I have tried iterating over the subfields the same way as the repeating field above and still cannot quite get it to work. For some reason it is not allowing the x_prepenZeros proc to be called correctly.
Here is the output for the PV1-9 field:
|018727^BABBAR^ELEPHANT~018400^BUDDY^TEST~018727^BABBAR^ELEPHANT|
Here is what the output should be:
|01800727^BABBAR^ELEPHANT~01800400^BUDDY^TEST~01800727^BABBAR^ELEPHANT|
The doctor numbers have to be at least 8 characters in length.
What am I missing here? Any help is appreciated.
Thanks David.
So something like this first then the code I below before?
set pv1_9_list [split [lindex $fields 9] $rep_sep]
February 5, 2009 at 8:47 pm in reply to: Adding PV1-3.4 Subfield to message when it doesn’t exist #66791We are eventually going to go back and build the variants and Xlates but for now we really don’t have the time to do it. I am going to try what you suggested and see if I can’t get it to work.
February 5, 2009 at 7:51 pm in reply to: Adding PV1-3.4 Subfield to message when it doesn’t exist #66789It is still not populating that subfield. Any other ideas?
February 5, 2009 at 5:33 pm in reply to: Adding PV1-3.4 Subfield to message when it doesn’t exist #66787I did and it still will not populate the field in the message.
February 5, 2009 at 5:14 pm in reply to: Adding PV1-3.4 Subfield to message when it doesn’t exist #66785since we are building Variants and Xlates. We inherited this when we came in a couple months ago.
February 5, 2009 at 4:52 pm in reply to: Adding PV1-3.4 Subfield to message when it doesn’t exist #66783######################################################################
# Name: z_fixHmsToMcKesson.0.1.tcl
#
# Purpose:
#
#
#
#
# UPoC type: tps
# Args: tps keyedlist containing the following keys:
# MODE run mode (“start”, “run” or “time”)
# MSGID message handle
# ARGS user-supplied arguments:
# Example: {HMSID 000} {MCKID A} {TOSYS HPF}
# hmsId mckId toSys
# cannot be: {{HMSID 000} {MCKID A} {TOSYS HPF}}
#
# Returns: tps disposition list:
#
# McH Procs included here:
# tps_chs_hmsdftadjust.tcl
# tps_chs_hmshciadjust.tcl
# Purpose: 1. Change from ZEM to ZPI.
# 2. Copy PV1-16 to PV2-21.
# #Will need to reorder NK1 to be before PV1 for HCI.
# This was not done in this proc.
# tps_chs_hmshlabadjust.tcl
# Purpose: 1. reformatting PID-10 (Race code), PID-15 (Language), PID-17 (Religion).
# tps_chs_hmshmmadjust.tcl
# Purpose: 1. reformatting PID-10 (Race code), PID-15 (Language), PID-17 (Religion).
# tps_chs_hmihomadjust.tcl
# Purpose: These coding are based on HRM-HOM implement doc Rev9.
# 1. 4.3.1.2 OBR4 modification and 4.3.1.7 rev9 – Re-format OBR-4.1 and OBR-4.3.
# Requires: chs_hrmhom_icd9.tbl
#
proc z_fixHmsToMcKesson.0.1 { args } {
keylget args MODE mode
set dispList {}
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}
run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mh
keylget args ARGS USERARGS
keylget args ARGS.HMSID hmsId
keylget args ARGS.MCKID mckId
keylget args ARGS.TOSYS toSys
set msg [msgget $mh]
set field_sep [csubstr $msg 3 1]
set sub_sep [csubstr $msg 4 1]
set ssub_sep [csubstr $msg 5 1]
set msg [split $msg r]
set today [exec date]
set tempvar “”
set tempObr “”
set tempOrc “”
set resetNk1 0
set resetObr 0
set resetOrc 0
set pv1_2 “”
set pv1_8 “”
set pv1_9 “”
set pv1_10 “”
set pv1_16 “”
set pv1_17 “”
set pv1_18 “”
set pv1_19 “”
set pv1_44 “”
set pv1_45 “”
foreach seg $msg {
set fields [split $seg |]
set type [csubstr $seg 0 3]
switch -exact — $type {
MSH {
set msg_type_1 [lindex [split [lindex $fields 8] $sub_sep] 0]
set msg_type_2 [lindex [split [lindex $fields 8] $sub_sep] 1]
catch {set fields [lreplace $fields 3 3 $mckId]}
if {$toSys == “PACS”} {
catch {set fields [lreplace $fields 4 4 $hmsId]}
} else {
catch {set fields [lreplace $fields 4 4 $toSys]}
}
catch {set fields [lreplace $fields 5 5 $mckId]}
if {($toSys == “HLAB”) && ($msg_type_2 == “A35”)} {
# change MSH-8 from A35 to A41.
catch {set fields [lreplace $fields 8 8 “ADT^A41”]}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
EVN {
if {($toSys == “HLAB”) && ($msg_type_2 == “A35”)} {
catch {set fields [lreplace $fields 1 1 “A41”]}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PID {
set pid10 [lindex $fields 10]
set pid15 [lindex $fields 15]
set msh3 $hmsId
set npid3 “”
set pid3 [lindex $fields 3]
append npid3 $pid3 $sub_sep $sub_sep $sub_sep “HMS” $msh3 $sub_sep “MR”
catch {set fields [lreplace $fields 3 3 $npid3]}
if {$toSys == “HMM”} {
# PID 10 table lookup
if {$pid10 != “”} {
set val1 “”
set val1 [tbllookup -side input hmshmm_race $pid10]
if {![cequal $val1 “”]} {
catch {set fields [lreplace $fields 10 10 $val1]}
}
}
# extract PID-15 (Language code).
if {$pid15 != “”} {
set val2 “”
set val2 [tbllookup -side input hmshmm_lang $pid15]
if {![cequal $val2 “”]} {
catch {set fields [lreplace $fields 15 15 $val2]}
}
}
}
# SSN formatting.
set pid19 [lindex $fields 19]
if {$pid19 != “”} {
if {[string length $pid19] > 9} {
set nssn “”
set pid19_1 [csubstr $pid19 0 3]
set pid19_2 [csubstr $pid19 3 2]
set pid19_3 [csubstr $pid19 5 4]
#
if {($pid19 == “888-88-8888”) || ($pid19 == “999-99-9999”)} {
catch {set fields [lreplace $fields 19 19 “”]}
} else {
append nssn $pid19_1 “-” $pid19_2 “-” $pid19_3
catch {set fields [lreplace $fields 19 19 $nssn]}
}
}
}
# blank out PID-18 for ONLY A34.
if {$msg_type_2 == “A34”} {
catch {set fields [lreplace $fields 18 18 “”]}
}
set pid23 [lindex $fields 23]
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PD1 {
#set pd1_4 [lindex $fields 4]
set pd1_4_list [split [lindex $fields 4] $sub_sep]
set DocNumber_4_0 [lindex $pd1_4_list 0]
if {$DocNumber_4_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_4_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pd1_4 [join [lreplace $pd1_4_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 4 4 $pv1_8]
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PV1 {
# Patient Class
set pv1_2 [lindex $fields 2]
# Assigned patient location
# .1 Nurse .2 Station/Point of care, .3 Room, .4 Bed,
# .5 facility, .6 location status, .7person location type,
# .8 building, .9 floor, .10 location description
set pv1_3 [lindex $fields 3]
set bed [lindex [split $pv1_3 $sub_sep] 2]
# Attending Doc
set pv1_7_list [split [lindex $fields 7] $sub_sep]
set DocNumber_7_0 [lindex $pv1_7_list 0]
if {$DocNumber_7_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_7_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pv1_7 [join [lreplace $pv1_7_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 7 7 $pv1_7]
}
# Referring Doc
#set pv1_8 [lindex $fields 8]
set pv1_8_list [split [lindex $fields 8] $sub_sep]
set DocNumber_8_0 [lindex $pv1_8_list 0]
if {$DocNumber_8_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_8_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pv1_8 [join [lreplace $pv1_8_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 8 8 $pv1_8]
}
# Consultinging Doc
#set pv1_9 [lindex $fields 9]
set pv1_9_list [split [lindex $fields 9] $sub_sep]
set DocNumber_9_0 [lindex $pv1_9_list 0]
if {$DocNumber_9_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_9_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pv1_9 [join [lreplace $pv1_9_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 9 9 $pv1_9]
}
set pv1_10 [lindex $fields 10]
# re-formatting PV1-3.
if {($pv1_3 == $pv1_10) && ($pv1_2 == “O”)} {
set pv1_3 “”
append pv1_3 “OP”
catch {set fieldList [lreplace $fieldList 3 3 $pv1_3]}
}
set pv1_16 [lindex $fields 16]
# Admitting Doc
#set pv1_17 [lindex $fields 17]
set pv1_17_list [split [lindex $fields 17] $sub_sep]
set DocNumber_17_0 [lindex $pv1_17_list 0]
if {$DocNumber_17_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_17_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pv1_17 [join [lreplace $pv1_17_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 17 17 $pv1_17]
}
set pv1_18 [lindex $fields 18]
# Visit Number
set pv1_19 [lindex $fields 19]
set pv1_45 [lindex $fields 45]
# Added code on 8/7/2008 to account for LAB and LAR in PV1-10.
if {$toSys == “HLAB”} {
if {$pid23 != “” && $pv1_10 == “LFR”} {
catch {set fields [lreplace $fields 3 3 $pid23]}
} elseif {$pid23 != “” && $pv1_10 == “LAB”} {
catch {set fields [lreplace $fields 3 3 $pid23]}
} elseif {$pid23 != “” && $pv1_10 == “LAR”} {
catch {set fields [lreplace $fields 3 3 $pid23]}
} elseif {$pid23 != “” && $pv1_10 == “IND”} {
catch {set fields [lreplace $fields 3 3 $pid23]}
}
}
if {($toSys == “HCI”) && ($pv1_2 == “O”)} {
if {$pv1_18 != “E”} {
catch {set fields [lreplace $fields 18 18 $pv1_10]}
}
}
if {($toSys == “HCI”) && ([cequal $pv1_2 “I”] || [cequal $pv1_10 “EOP”])} {
catch {set fields [lreplace $fields 18 18 $pv1_10]}
}
########### HMM
if {$toSys == “HMM”} {
set it [tbllookup hmshmm_hospService $pv1_10]
if {$pv1_45 != “” && $msg_type_2 == “A08” && $bed == “” && $pv1_2 == “O” && $pv1_18 == “E” && $it == 0} {
catch {set fieldList [lreplace $fieldList 45 45 “”]}
}
# code below is added on June 2, 2008.
catch {set fieldList [lreplace $fieldList 18 18 $pv1_10]}
# code below is added on June 19, 2008. RQ by Jawad.
if {$msg_type_2 == “A05”} {
catch {set fieldList [lreplace $fieldList 44 44 $pv2_8]}
}
}
#
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PV2 {
set pv2_8 [lindex $fields 8]
if {$msg_type_2 == “A11”} {
catch {set fields [lreplace $fields 8 8 “”””]}
}
if {($toSys == “HCI”) && ($pv1_16 != “”)} {
catch {set fields [lreplace $fields 21 21 $pv1_16]}
}
catch {set fields [lreplace $fields 18 18 $pv1_10]}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
NK1 {
set segment [join $fields $field_sep]
if {$toSys == “HCI”} {
set resetNk1 1
append tempvar ${segment}r
} else {
append newMsg ${segment}r
}
}
ORC {
# Ordering Doc
set orc_12_list [split [lindex $fields 12] $sub_sep]
set DocNumber_12_0 [lindex $orc_12_list 0]
if {$DocNumber_12_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_12_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set orc_12 [join [lreplace $orc_12_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 12 12 $orc_12]
}
#To go back and change ORC.2 to Unique ID
if {($toSys == “HCI”) && ([regexp $msg_type_1 “ORU|ORM|BAR”])} {
set resetOrc 1
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
OBR {
set obr2 [lindex $fields 2]
# Remove trailing sub seperator in OBR.2
set obr2 [lindex $fields 2]
catch {set obr2 [string trimright $obr2 $sub_sep]}
catch {set fields [lreplace $fields 2 2 $obr2]}
#
if {$toSys == “HOM”} {
set obr4 [lindex $fields 4]
set obr4_1 [lindex [split $obr4 ^] 0]
set obr4_3 [lindex [split $obr4 ^] 2]
if {$obr4_1 != “”} {
set obr4_x [csubstr $obr4_1 0 3]
set retval [tbllookup chs_hrmhom_icd9.tbl $obr4_x]
catch {set fields [lreplace $fields 2 2 $retval]}
}
}
# Ordering Doc
set obr_16_list [split [lindex $fields 16] $sub_sep]
set DocNumber_16_0 [lindex $obr_16_list 0]
if {$DocNumber_16_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_16_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set obr_16 [join [lreplace $obr_16_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 16 16 $obr_16]
}
# Unique Id for HCI from OBR.20
# To go into OBR.2 and ORC.2
set segment [join $fields $field_sep]
if {($toSys == “HCI”) && ([regexp $msg_type_1 “ORU|ORM|BAR”])} {
set obr_20 [lindex $fields 20]
catch {set fields [lreplace $fields 2 2 $obr_20]}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
OBX {
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
ACC {
set acc_1 [lindex $fields 1]
if {$acc_1 != “”} {
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
}
GT1 {
set gt1_12 [lindex $fields 12]
if {[string length $gt1_12] == 9} {
set ngt1_12 “”
set gt1_12_1 [csubstr $gt1_12 0 3]
set gt1_12_2 [csubstr $gt1_12 3 2]
set gt1_12_3 [csubstr $gt1_12 5 4]
#
append ngt1_12 $gt1_12_1 “-” $gt1_12_2 “-” $gt1_12_3
catch {set fieldList [lreplace $fields 12 12 $ngt1_12]}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
FT1 {
if {$msg_type_1 == “DFT”} {
set ft1_10 [lindex $fields 10]
# Don’t do anything if FT1-10 is less then 999.
if {$ft1_10 > 999} {
# determine the number of FT1 segments that need to be created.
set tempvar “”
set i 1
set ncnt [expr $ft1_10 / 999]
set remainder [expr $ft1_10 % 999]
while {$i <= $ncnt} {
catch {set fields [lreplace $fields 10 10 “999”]}
catch {set fields [lreplace $fields 1 1 $i]}
set segment [join $fields $field_sep]
append newMsg ${segment}r
incr i
}
# NOW create the FT1-segment with the remainder value.
if {$remainder != 0} {
catch {set fields [lreplace $fields 10 10 $remainder]}
catch {set fields [lreplace $fields 1 1 $i]}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
}
}
}
MFE {
#set mfe_4 [lindex $fields 4]
set mfe_4_list [split [lindex $fields 4] $sub_sep]
set DocNumber_4_0 [lindex $mfe_4_list 0]
if {$DocNumber_4_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_4_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set mfe_4 [join [lreplace $mfe_4_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 4 4 $mfe_4]
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PR1 {
#set pr1_11 [lindex $fields 11]
set pr1_11_list [split [lindex $fields 11] $sub_sep]
set DocNumber_11_0 [lindex $pr1_11_list 0]
if {$DocNumber_11_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_11_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pr1_11 [join [lreplace $pr1_11_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 11 11 $pr1_11]
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
PRA {
#set pra_1 [lindex $fields 1]
set pra_1_list [split [lindex $fields 1] $sub_sep]
set DocNumber_1_0 [lindex $pra_1_list 0]
if {$DocNumber_1_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_1_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pra_1 [join [lreplace $pra_1_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 1 1 $pra_1]
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
STF {
#set stf_1 [lindex $fields 1]
set stf_1_list [split [lindex $fields 1] $sub_sep]
set DocNumber_1_0 [lindex $stf_1_list 0]
if {$DocNumber_1_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_1_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set stf_1 [join [lreplace $stf_1_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 1 1 $stf_1]
}
#set stf_2 [lindex $fields 2]
set stf_2_list [split [lindex $fields 2] $sub_sep]
set DocNumber_2_0 [lindex $stf_2_list 0]
if {$DocNumber_2_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_2_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set stf_2 [join [lreplace $stf_2_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 2 2 $stf_2]
}
if {$msg_type_1 == “MFN”} {
set stf10 [lindex $fields 10]
set stf10_list [split $stf10 $ssub_sep]
if {$stf10 != “”} {
set nval “”
set wpn “”
set orn “”
set bpn “”
set prn “”
#
foreach x $stf10_list {
if {$x != “”} {
set x_list [split $x $sub_sep]
set x_1 [lindex $x_list 0]
set x_2 [lindex $x_list 1]
set x_3 [lindex $x_list 2]
if {$x_2 == “WPN”} {
append wpn $x_1 “CO”
}
if {$x_2 == “ORN”} {
append orn $x_1 “CF”
}
if {$x_2 == “BPN”} {
append bpn $x_1 “CB”
}
if {$x_2 == “PRN”} {
append prn $x_1 “CH”
}
}
}
append nval $wpn $ssub_sep $orn $ssub_sep $bpn $ssub_sep $prn
catch {set fields [lreplace $fields 10 10 $nval]}
}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
MRG {
set mrg1 [lindex $fields 1]
append nmrg1 $mrg1 $sub_sep $sub_sep $sub_sep “HMS” $msh3 $sub_sep
catch {set fields [lreplace $fields 1 1 $nmrg1]}
if {$msg_type_2 == “A35”} {
catch {set fields [lreplace $fields 1 1 $npid3]}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
ZEM {
#set fields [split $segment $field_sep]
set zem1 [lindex $fields 1]
set zem1_1 “”
if {$zem1 != “”} {
set zem_1_1 [lindex [split $zem1 $sub_sep] 1]
set zem2 [lindex [split $zem1 $sub_sep] 2]
set segment “ZPI|1||||||||||||||$zem1_1|$zem2|”
append newMsg ${segment}r
}
}
ZIT {
if {$toSys == “HSM”} {
set zit18 [lindex $fields 18]
if {$zit18 != “”} {
set retval [tbllookup -side input chs_hmshsm.tbl $zit18]
catch {set fields [lreplace $fields 33 33 $retval]}
}
}
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
ZMF {
#set zmf_1 [lindex $fields 1]
set zmf_1_list [split [lindex $fields 1] $sub_sep]
set DocNumber_1_0 [lindex $zmf_1_list 0]
if {$DocNumber_1_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_1_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set zmf_1 [join [lreplace $zmf_1_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 1 1 $zmf_1]
}
}
default {
if {$seg != “”} {
puts “Untouched Segment: [lindex $fields 0]”
set segment [join $fields $field_sep]
append newMsg ${segment}r
}
}
}
}
# If NK1 present and toSys is HCI; place NK1 prior to PV1
if {$resetNk1 == “1”} {
set msg [split $newMsg r]
set newMsg “”
foreach seg $msg {
set type [csubstr $seg 0 3]
switch -exact — $type {
PV1 {
append newMsg ${tempvar}
append newMsg ${seg}r
}
default {
append newMsg ${seg}r
}
}
}
}
#To go back and change ORC.2 to Unique ID
# if $resetOrc == 1
if {$resetOrc == “1”} {
set msg [split $newMsg r]
set newMsg “”
foreach seg $msg {
set type [csubstr $seg 0 3]
switch -exact — $type {
ORC {
catch {set fields [lreplace $fields 2 2 $obr_20]}
append newMsg ${seg}r
}
default {
append newMsg ${seg}r
}
}
}
}
msgset $mh $newMsg
lappend dispList “CONTINUE $mh”
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
}
return $dispList
}
Would that work like this:
{PASSCOND ~REGEX@NULL} {SEGNAME PV1} {FIELDNUM 1} {SUBFIELDNUM 0}
or
{PASSCOND ~@NULL} {SEGNAME PV1} {FIELDNUM 1} {SUBFIELDNUM 0}
I appreciate the help on this.
Ours in in our IS department but we do not have a CIS department. I am the only engine person at our hospital. That is not always a good thing. -
AuthorReplies