HLCSRPT1 ;ISC-SF/RAH-TRANS LOG PENDING MSG LIST;05/12/03 11:43 AM [ 12/23/2003 4:01 PM ]
;;1.6;HEALTH LEVEL SEVEN;**19,50,107,1005**;Oct 13, 1995
;
Q
;
EN ; Entry Point for Pending Message Search.
D LNKSRCH Q:$D(STOP)
I HLCSLS=1 D SEARCH1 Q
D SEARCH2
Q
;
;
SEARCH1 ;
W !!," . . . PLEASE WAIT, THIS CAN TAKE AWHILE . . .",!
S HLCSI=0,HLCSIO="" S HLCSLN=0
F S HLCSIO=$O(^HLMA("AC",HLCSIO)) Q:(HLCSIO="") D
. S HLCSN=HLCSI,HLCSJ=0
. F S HLCSJ=$O(^HLMA("AC",HLCSIO,HLCSLINK,HLCSJ)) Q:(HLCSJ="") D
.. I '$D(^HLMA(HLCSJ,0)) Q
.. I '$D(^HLMA("AG",1,HLCSJ)) Q
.. S HLCSX=^HLMA(HLCSJ,0),HLCSDTE=$P(HLCSX,U,1)
.. S HLCSLNK=" "
.. I $D(^HLCS(870,HLCSLINK,0)) S HLCSLNK=$P(^HLCS(870,HLCSLINK,0),U,1)
.. S HLCSEVN1=$P(HLCSX,U,13) I HLCSEVN1'="",($D(^HL(771.2,HLCSEVN1,0))) S HLCSEVN1=$P(^HL(771.2,HLCSEVN1,0),U,1)
.. S HLCSEVN2=$P(HLCSX,U,14) I HLCSEVN2'="",($D(^HL(779.001,HLCSEVN2,0))) S HLCSEVN2=$P(^HL(779.001,HLCSEVN2,0),U,1)
.. I HLCSEVN1="" S HLCSEVN1=" "
.. I HLCSEVN2="" S HLCSEVN2=" "
.. I $L(HLCSEVN1)<3 S HLCSEVN1=HLCSEVN1_" ",HLCSEVN1=$E(HLCSEVN1,1,3)
.. I $L(HLCSEVN2)<3 S HLCSEVN2=HLCSEVN2_" ",HLCSEVN2=$E(HLCSEVN2,1,3)
.. S HLCSEVN=HLCSEVN1_":"_HLCSEVN2
.. D FORMAT^HLCSRPT
.. Q
. Q
I '$D(^TMP("TLOG",$J,1)) W !!,HLCSNREC,!! S DIR(0)="E" D ^DIR K DIR Q
I VERS22'="YES" S HLCSTITL="IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR"
E S HLCSTITL="MESSAGE ID # D/T Entered Log Link Msg:Evn IO Sndg Apl Rcvr Apl "
I VERS22'="YES" D FAKR
D DISPLAY^HLCSRPT K ^TMP("TLOG",$J)
Q
;
SEARCH2 ;
W !!," . . . PLEASE WAIT, THIS CAN TAKE AWHILE . . .",!
S HLCSI=0,HLCSIO="" S HLCSLN=0
F S HLCSIO=$O(^HLMA("AC",HLCSIO)) Q:(HLCSIO="") D
. S HLCSN=HLCSI,HLCSJ=0,HLCSLINK=0
. F S HLCSLINK=$O(^HLMA("AC",HLCSIO,HLCSLINK)) Q:(HLCSLINK="") D
.. F S HLCSJ=$O(^HLMA("AC",HLCSIO,HLCSLINK,HLCSJ)) Q:(HLCSJ="") D
... I '$D(^HLMA(HLCSJ,0)) Q
... I '$D(^HLMA("AG",1,HLCSJ)) Q
... S HLCSX=^HLMA(HLCSJ,0),HLCSDTE=$P(HLCSX,U,1)
... S HLCSLNK=" "
... I $D(^HLCS(870,HLCSLINK,0)) S HLCSLNK=$P(^HLCS(870,HLCSLINK,0),U,1)
... S HLCSEVN1=$P(HLCSX,U,13) I HLCSEVN1'="",($D(^HL(771.2,HLCSEVN1,0))) S HLCSEVN1=$P(^HL(771.2,HLCSEVN1,0),U,1)
... S HLCSEVN2=$P(HLCSX,U,14) I HLCSEVN2'="",($D(^HL(779.001,HLCSEVN2,0))) S HLCSEVN2=$P(^HL(779.001,HLCSEVN2,0),U,1)
... I HLCSEVN1="" S HLCSEVN1=" "
... I HLCSEVN2="" S HLCSEVN2=" "
... I $L(HLCSEVN1)<3 S HLCSEVN1=HLCSEVN1_" ",HLCSEVN1=$E(HLCSEVN1,1,3)
... I $L(HLCSEVN2)<3 S HLCSEVN2=HLCSEVN2_" ",HLCSEVN2=$E(HLCSEVN2,1,3)
... S HLCSEVN=HLCSEVN1_":"_HLCSEVN2
... D FORMAT^HLCSRPT
... Q
.. Q
. Q
I '$D(^TMP("TLOG",$J,1)) W !!,HLCSNREC,!! S DIR(0)="E" D ^DIR K DIR Q
I VERS22'="YES" S HLCSTITL="IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR"
E S HLCSTITL="MESSAGE ID # D/T Entered Log Link Msg:Evn IO Sndg Apl Rcvr Apl "
I VERS22'="YES" D FAKR
D DISPLAY^HLCSRPT K ^TMP("TLOG",$J)
Q
;
LNKSRCH ; Report pending messages on A logical link.
W @IOF,! S HLCSHDR="Logical Link Selection" D HLCSBAR
S DIR(0)="PAO^870:AEO",DIR("A")="Select Logical Link: ALL//"
D ^DIR S:($D(DTOUT)!($D(DUOUT))) STOP=1 Q:$D(STOP)
I X="" S HLCSLS="" K DIR,X,Y Q
I Y=-1 W !,X_" NOT VALID " K X,Y G LNKSRCH
S HLCSLINK=$P(Y,U,1),HLCSLNK=$P(Y,U,2) K DIR,X,Y
S HLCSLS=1
Q
;
FAKR ; Build fake record to pass FM21 Browser edits.
S HLCSJ=^TMP("TLOG",$J,1)
S HLCSJ=+$P(HLCSJ," ",1)
S ^TMP($J,"MESSAGE",HLCSJ,0)="^^1^1"
S ^TMP($J,"MESSAGE",HLCSJ,1,0)=" Fake Record to pass Browser edits. "
S HLCSRNO=HLCSJ
Q
;
SHOWMSG(XXY,XXZ) ;
; Each node, ^tmp($j,"message",record_ien), invokes this code
; to compile a 'virtual w-p document' when a message is browsed.
I $D(^HLMA(XXY,"MSH",0)) D
. S ^TMP($J,"MESSAGE",XXY,0)=^HLMA(XXY,"MSH",0)
. S YY1=$P(^HLMA(XXY,"MSH",0),U,3),YY2=$P(^HLMA(XXY,"MSH",0),U,4)
E S ^TMP($J,"MESSAGE",XXY,0)="1^1"
S XLINE=^HLMA(XXY,0)
S LINE="Record #: "_XXY_" ",LINE=$E(LINE,1,30)
S LINE=LINE_"Message #: "_$P(XLINE,U,2)
S ^TMP($J,"MESSAGE",XXY,1,0)=LINE
S DTE=$P(XLINE,U,1) I $P($G(^HL(772,DTE,0)),U,1)'="" S DTE=$P(^HL(772,DTE,0),U,1),DTE=$E(DTE,4,7)_$E(DTE,2,3)_"."_$P(DTE,".",2)_" "
I $D(^HLMA(XXY,"S")),$P(^HLMA(XXY,"S"),U,1)'="" S DTP=$P(^HLMA(XXY,"S"),U,1) S DTP=$E(DTP,4,7)_$E(DTP,2,3)_"."_$P(DTP,".",2)
E S DTP=" "
S LINE="D/T Entered: "_DTE,LINE=$E(LINE,1,30)_"D/T Processed: "_DTP
S ^TMP($J,"MESSAGE",XXY,2,0)=LINE K DTE,DTP
S LINE="Logical Link: " I $P(XLINE,U,7)'="",($D(^HLCS(870,$P(XLINE,U,7),0))) S LINE=LINE_$P(^HLCS(870,$P(XLINE,U,7),0),U,1)
S LINE=LINE_" ",LINE=$E(LINE,1,30)
S LINE=LINE_"Ack To MSG#: " I $P(XLINE,U,6)'="",($D(^HLMA($P(XLINE,U,6),0))) S LINE=LINE_$P(^HLMA($P(XLINE,U,6),0),U,2)
S ^TMP($J,"MESSAGE",XXY,3,0)=LINE
S DTS="" I $P($G(^HLMA(XXY,"P")),U,2)'="" S DTS=$P(^HLMA(XXY,"P"),U,2),DTS=$E(DTS,4,7)_$E(DTS,2,3)_"."_$P(DTS,".",2)
S LINE="D/T STATUS: "_DTS_" ",LINE=$E(LINE,1,30),LINE=LINE_"STATUS: "
I $P(^HLMA(XXY,"P"),U,1)'="" S LINE=LINE_$P(^HL(771.6,+$P(^HLMA(XXY,"P"),U,1),0),U,1)
S ^TMP($J,"MESSAGE",XXY,4,0)=LINE K DTS
S LINE="ERR MSG: " I $P(^HLMA(XXY,"P"),U,3)'="" S LINE=LINE_$E($P(^HLMA(XXY,"P"),U,3),1,20)
S LINE=LINE_" ",LINE=$E(LINE,1,30)_"ERR TYPE: "
I $P(^HLMA(XXY,"P"),U,4)'="" S LINE=LINE_$P(^HL(771.7,+$P(^HLMA(XXY,"P"),U,4),0),U,1)
S ^TMP($J,"MESSAGE",XXY,5,0)=LINE
S LINE="Sending Appl: " I $P(XLINE,U,11)'="",($D(^HL(771,$P(XLINE,U,11),0))) S LINE=LINE_$P(^HL(771,$P(XLINE,U,11),0),U,1)
S ^TMP($J,"MESSAGE",XXY,6,0)=LINE
S LINE="Receiving Appl: " I $P(XLINE,U,12)'="",($D(^HL(771,$P(XLINE,U,12),0))) S LINE=LINE_$P(^HL(771,$P(XLINE,U,12),0),U,1)
S ^TMP($J,"MESSAGE",XXY,7,0)=LINE
S LINE="Message Type: " I $P(XLINE,U,13)'="",($D(^HL(771.2,$P(XLINE,U,13),0))) S LINE=LINE_$P(^HL(771.2,$P(XLINE,U,13),0),U,1)
S LINE=LINE_" ",LINE=$E(LINE,1,30)_"Event Type: "
I $P(XLINE,U,14)'="",($D(^HL(779.001,$P(XLINE,U,14),0))) S LINE=LINE_$P(^HL(779.001,$P(XLINE,U,14),0),U,1)
S ^TMP($J,"MESSAGE",XXY,8,0)=LINE K LINE,XLINE
S ^TMP($J,"MESSAGE",XXY,9,0)="MESSAGE HEADER: "
S LN1=.5,LN2=10
I $D(^HLMA(XXY,"MSH",0)) D
. F S LN1=$O(^HLMA(XXY,"MSH",LN1)) Q:LN1="" D
.. S ^TMP($J,"MESSAGE",XXY,LN2,0)=^HLMA(XXY,"MSH",LN1,0)
.. ;HL*1.6*107 start: to fix the multiple lines per segment
.. ;S LN2=LN2+1,LN1=LN1+1
.. S LN2=LN2+1
.. ;HL*1.6*107 end
..Q
S LN1=.5
S ^TMP($J,"MESSAGE",XXY,LN2,0)="MESSAGE TEXT: ",LN2=LN2+1
I $D(^HL(772,XXZ,"IN",0)) D
. F S LN1=$O(^HL(772,XXZ,"IN",LN1)) Q:(LN1="") D
.. S ^TMP($J,"MESSAGE",XXY,LN2,0)=^HL(772,XXZ,"IN",LN1,0)
.. ;HL*1.6*107 start: to fix the multiple lines per segment
.. ;S LN2=LN2+1,LN1=LN1+1
.. S LN2=LN2+1
.. ;HL*1.6*107 end
..Q
S (YY1,YY2)=LN2-1
S Y1Y2=YY1_"^"_YY2
S $P(^TMP($J,"MESSAGE",XXY,0),U,3,4)=Y1Y2
K LN1,LN2,Y1Y2,YY1,YY2
Q
;
HLCSBAR ; Center Title on Top Line of Screen
W RVON,?(80-$L(HLCSHDR)\2),HLCSHDR,$E(SPACE,$X,77),RVOFF,!
Q
;
HLCSRPT1 ;ISC-SF/RAH-TRANS LOG PENDING MSG LIST;05/12/03 11:43 AM [ 12/23/2003 4:01 PM ]
+1 ;;1.6;HEALTH LEVEL SEVEN;**19,50,107,1005**;Oct 13, 1995
+2 ;
+3 QUIT
+4 ;
EN ; Entry Point for Pending Message Search.
+1 DO LNKSRCH
IF $DATA(STOP)
QUIT
+2 IF HLCSLS=1
DO SEARCH1
QUIT
+3 DO SEARCH2
+4 QUIT
+5 ;
+6 ;
SEARCH1 ;
+1 WRITE !!," . . . PLEASE WAIT, THIS CAN TAKE AWHILE . . .",!
+2 SET HLCSI=0
SET HLCSIO=""
SET HLCSLN=0
+3 FOR
SET HLCSIO=$ORDER(^HLMA("AC",HLCSIO))
IF (HLCSIO="")
QUIT
Begin DoDot:1
+4 SET HLCSN=HLCSI
SET HLCSJ=0
+5 FOR
SET HLCSJ=$ORDER(^HLMA("AC",HLCSIO,HLCSLINK,HLCSJ))
IF (HLCSJ="")
QUIT
Begin DoDot:2
+6 IF '$DATA(^HLMA(HLCSJ,0))
QUIT
+7 IF '$DATA(^HLMA("AG",1,HLCSJ))
QUIT
+8 SET HLCSX=^HLMA(HLCSJ,0)
SET HLCSDTE=$PIECE(HLCSX,U,1)
+9 SET HLCSLNK=" "
+10 IF $DATA(^HLCS(870,HLCSLINK,0))
SET HLCSLNK=$PIECE(^HLCS(870,HLCSLINK,0),U,1)
+11 SET HLCSEVN1=$PIECE(HLCSX,U,13)
IF HLCSEVN1'=""
IF ($DATA(^HL(771.2,HLCSEVN1,0)))
SET HLCSEVN1=$PIECE(^HL(771.2,HLCSEVN1,0),U,1)
+12 SET HLCSEVN2=$PIECE(HLCSX,U,14)
IF HLCSEVN2'=""
IF ($DATA(^HL(779.001,HLCSEVN2,0)))
SET HLCSEVN2=$PIECE(^HL(779.001,HLCSEVN2,0),U,1)
+13 IF HLCSEVN1=""
SET HLCSEVN1=" "
+14 IF HLCSEVN2=""
SET HLCSEVN2=" "
+15 IF $LENGTH(HLCSEVN1)<3
SET HLCSEVN1=HLCSEVN1_" "
SET HLCSEVN1=$EXTRACT(HLCSEVN1,1,3)
+16 IF $LENGTH(HLCSEVN2)<3
SET HLCSEVN2=HLCSEVN2_" "
SET HLCSEVN2=$EXTRACT(HLCSEVN2,1,3)
+17 SET HLCSEVN=HLCSEVN1_":"_HLCSEVN2
+18 DO FORMAT^HLCSRPT
+19 QUIT
End DoDot:2
+20 QUIT
End DoDot:1
+21 IF '$DATA(^TMP("TLOG",$JOB,1))
WRITE !!,HLCSNREC,!!
SET DIR(0)="E"
DO ^DIR
KILL DIR
QUIT
+22 IF VERS22'="YES"
SET HLCSTITL="IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR"
+23 IF '$TEST
SET HLCSTITL="MESSAGE ID # D/T Entered Log Link Msg:Evn IO Sndg Apl Rcvr Apl "
+24 IF VERS22'="YES"
DO FAKR
+25 DO DISPLAY^HLCSRPT
KILL ^TMP("TLOG",$JOB)
+26 QUIT
+27 ;
SEARCH2 ;
+1 WRITE !!," . . . PLEASE WAIT, THIS CAN TAKE AWHILE . . .",!
+2 SET HLCSI=0
SET HLCSIO=""
SET HLCSLN=0
+3 FOR
SET HLCSIO=$ORDER(^HLMA("AC",HLCSIO))
IF (HLCSIO="")
QUIT
Begin DoDot:1
+4 SET HLCSN=HLCSI
SET HLCSJ=0
SET HLCSLINK=0
+5 FOR
SET HLCSLINK=$ORDER(^HLMA("AC",HLCSIO,HLCSLINK))
IF (HLCSLINK="")
QUIT
Begin DoDot:2
+6 FOR
SET HLCSJ=$ORDER(^HLMA("AC",HLCSIO,HLCSLINK,HLCSJ))
IF (HLCSJ="")
QUIT
Begin DoDot:3
+7 IF '$DATA(^HLMA(HLCSJ,0))
QUIT
+8 IF '$DATA(^HLMA("AG",1,HLCSJ))
QUIT
+9 SET HLCSX=^HLMA(HLCSJ,0)
SET HLCSDTE=$PIECE(HLCSX,U,1)
+10 SET HLCSLNK=" "
+11 IF $DATA(^HLCS(870,HLCSLINK,0))
SET HLCSLNK=$PIECE(^HLCS(870,HLCSLINK,0),U,1)
+12 SET HLCSEVN1=$PIECE(HLCSX,U,13)
IF HLCSEVN1'=""
IF ($DATA(^HL(771.2,HLCSEVN1,0)))
SET HLCSEVN1=$PIECE(^HL(771.2,HLCSEVN1,0),U,1)
+13 SET HLCSEVN2=$PIECE(HLCSX,U,14)
IF HLCSEVN2'=""
IF ($DATA(^HL(779.001,HLCSEVN2,0)))
SET HLCSEVN2=$PIECE(^HL(779.001,HLCSEVN2,0),U,1)
+14 IF HLCSEVN1=""
SET HLCSEVN1=" "
+15 IF HLCSEVN2=""
SET HLCSEVN2=" "
+16 IF $LENGTH(HLCSEVN1)<3
SET HLCSEVN1=HLCSEVN1_" "
SET HLCSEVN1=$EXTRACT(HLCSEVN1,1,3)
+17 IF $LENGTH(HLCSEVN2)<3
SET HLCSEVN2=HLCSEVN2_" "
SET HLCSEVN2=$EXTRACT(HLCSEVN2,1,3)
+18 SET HLCSEVN=HLCSEVN1_":"_HLCSEVN2
+19 DO FORMAT^HLCSRPT
+20 QUIT
End DoDot:3
+21 QUIT
End DoDot:2
+22 QUIT
End DoDot:1
+23 IF '$DATA(^TMP("TLOG",$JOB,1))
WRITE !!,HLCSNREC,!!
SET DIR(0)="E"
DO ^DIR
KILL DIR
QUIT
+24 IF VERS22'="YES"
SET HLCSTITL="IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR"
+25 IF '$TEST
SET HLCSTITL="MESSAGE ID # D/T Entered Log Link Msg:Evn IO Sndg Apl Rcvr Apl "
+26 IF VERS22'="YES"
DO FAKR
+27 DO DISPLAY^HLCSRPT
KILL ^TMP("TLOG",$JOB)
+28 QUIT
+29 ;
LNKSRCH ; Report pending messages on A logical link.
+1 WRITE @IOF,!
SET HLCSHDR="Logical Link Selection"
DO HLCSBAR
+2 SET DIR(0)="PAO^870:AEO"
SET DIR("A")="Select Logical Link: ALL//"
+3 DO ^DIR
IF ($DATA(DTOUT)!($DATA(DUOUT)))
SET STOP=1
IF $DATA(STOP)
QUIT
+4 IF X=""
SET HLCSLS=""
KILL DIR,X,Y
QUIT
+5 IF Y=-1
WRITE !,X_" NOT VALID "
KILL X,Y
GOTO LNKSRCH
+6 SET HLCSLINK=$PIECE(Y,U,1)
SET HLCSLNK=$PIECE(Y,U,2)
KILL DIR,X,Y
+7 SET HLCSLS=1
+8 QUIT
+9 ;
FAKR ; Build fake record to pass FM21 Browser edits.
+1 SET HLCSJ=^TMP("TLOG",$JOB,1)
+2 SET HLCSJ=+$PIECE(HLCSJ," ",1)
+3 SET ^TMP($JOB,"MESSAGE",HLCSJ,0)="^^1^1"
+4 SET ^TMP($JOB,"MESSAGE",HLCSJ,1,0)=" Fake Record to pass Browser edits. "
+5 SET HLCSRNO=HLCSJ
+6 QUIT
+7 ;
SHOWMSG(XXY,XXZ) ;
+1 ; Each node, ^tmp($j,"message",record_ien), invokes this code
+2 ; to compile a 'virtual w-p document' when a message is browsed.
+3 IF $DATA(^HLMA(XXY,"MSH",0))
Begin DoDot:1
+4 SET ^TMP($JOB,"MESSAGE",XXY,0)=^HLMA(XXY,"MSH",0)
+5 SET YY1=$PIECE(^HLMA(XXY,"MSH",0),U,3)
SET YY2=$PIECE(^HLMA(XXY,"MSH",0),U,4)
End DoDot:1
+6 IF '$TEST
SET ^TMP($JOB,"MESSAGE",XXY,0)="1^1"
+7 SET XLINE=^HLMA(XXY,0)
+8 SET LINE="Record #: "_XXY_" "
SET LINE=$EXTRACT(LINE,1,30)
+9 SET LINE=LINE_"Message #: "_$PIECE(XLINE,U,2)
+10 SET ^TMP($JOB,"MESSAGE",XXY,1,0)=LINE
+11 SET DTE=$PIECE(XLINE,U,1)
IF $PIECE($GET(^HL(772,DTE,0)),U,1)'=""
SET DTE=$PIECE(^HL(772,DTE,0),U,1)
SET DTE=$EXTRACT(DTE,4,7)_$EXTRACT(DTE,2,3)_"."_$PIECE(DTE,".",2)_" "
+12 IF $DATA(^HLMA(XXY,"S"))
IF $PIECE(^HLMA(XXY,"S"),U,1)'=""
SET DTP=$PIECE(^HLMA(XXY,"S"),U,1)
SET DTP=$EXTRACT(DTP,4,7)_$EXTRACT(DTP,2,3)_"."_$PIECE(DTP,".",2)
+13 IF '$TEST
SET DTP=" "
+14 SET LINE="D/T Entered: "_DTE
SET LINE=$EXTRACT(LINE,1,30)_"D/T Processed: "_DTP
+15 SET ^TMP($JOB,"MESSAGE",XXY,2,0)=LINE
KILL DTE,DTP
+16 SET LINE="Logical Link: "
IF $PIECE(XLINE,U,7)'=""
IF ($DATA(^HLCS(870,$PIECE(XLINE,U,7),0)))
SET LINE=LINE_$PIECE(^HLCS(870,$PIECE(XLINE,U,7),0),U,1)
+17 SET LINE=LINE_" "
SET LINE=$EXTRACT(LINE,1,30)
+18 SET LINE=LINE_"Ack To MSG#: "
IF $PIECE(XLINE,U,6)'=""
IF ($DATA(^HLMA($PIECE(XLINE,U,6),0)))
SET LINE=LINE_$PIECE(^HLMA($PIECE(XLINE,U,6),0),U,2)
+19 SET ^TMP($JOB,"MESSAGE",XXY,3,0)=LINE
+20 SET DTS=""
IF $PIECE($GET(^HLMA(XXY,"P")),U,2)'=""
SET DTS=$PIECE(^HLMA(XXY,"P"),U,2)
SET DTS=$EXTRACT(DTS,4,7)_$EXTRACT(DTS,2,3)_"."_$PIECE(DTS,".",2)
+21 SET LINE="D/T STATUS: "_DTS_" "
SET LINE=$EXTRACT(LINE,1,30)
SET LINE=LINE_"STATUS: "
+22 IF $PIECE(^HLMA(XXY,"P"),U,1)'=""
SET LINE=LINE_$PIECE(^HL(771.6,+$PIECE(^HLMA(XXY,"P"),U,1),0),U,1)
+23 SET ^TMP($JOB,"MESSAGE",XXY,4,0)=LINE
KILL DTS
+24 SET LINE="ERR MSG: "
IF $PIECE(^HLMA(XXY,"P"),U,3)'=""
SET LINE=LINE_$EXTRACT($PIECE(^HLMA(XXY,"P"),U,3),1,20)
+25 SET LINE=LINE_" "
SET LINE=$EXTRACT(LINE,1,30)_"ERR TYPE: "
+26 IF $PIECE(^HLMA(XXY,"P"),U,4)'=""
SET LINE=LINE_$PIECE(^HL(771.7,+$PIECE(^HLMA(XXY,"P"),U,4),0),U,1)
+27 SET ^TMP($JOB,"MESSAGE",XXY,5,0)=LINE
+28 SET LINE="Sending Appl: "
IF $PIECE(XLINE,U,11)'=""
IF ($DATA(^HL(771,$PIECE(XLINE,U,11),0)))
SET LINE=LINE_$PIECE(^HL(771,$PIECE(XLINE,U,11),0),U,1)
+29 SET ^TMP($JOB,"MESSAGE",XXY,6,0)=LINE
+30 SET LINE="Receiving Appl: "
IF $PIECE(XLINE,U,12)'=""
IF ($DATA(^HL(771,$PIECE(XLINE,U,12),0)))
SET LINE=LINE_$PIECE(^HL(771,$PIECE(XLINE,U,12),0),U,1)
+31 SET ^TMP($JOB,"MESSAGE",XXY,7,0)=LINE
+32 SET LINE="Message Type: "
IF $PIECE(XLINE,U,13)'=""
IF ($DATA(^HL(771.2,$PIECE(XLINE,U,13),0)))
SET LINE=LINE_$PIECE(^HL(771.2,$PIECE(XLINE,U,13),0),U,1)
+33 SET LINE=LINE_" "
SET LINE=$EXTRACT(LINE,1,30)_"Event Type: "
+34 IF $PIECE(XLINE,U,14)'=""
IF ($DATA(^HL(779.001,$PIECE(XLINE,U,14),0)))
SET LINE=LINE_$PIECE(^HL(779.001,$PIECE(XLINE,U,14),0),U,1)
+35 SET ^TMP($JOB,"MESSAGE",XXY,8,0)=LINE
KILL LINE,XLINE
+36 SET ^TMP($JOB,"MESSAGE",XXY,9,0)="MESSAGE HEADER: "
+37 SET LN1=.5
SET LN2=10
+38 IF $DATA(^HLMA(XXY,"MSH",0))
Begin DoDot:1
+39 FOR
SET LN1=$ORDER(^HLMA(XXY,"MSH",LN1))
IF LN1=""
QUIT
Begin DoDot:2
+40 SET ^TMP($JOB,"MESSAGE",XXY,LN2,0)=^HLMA(XXY,"MSH",LN1,0)
+41 ;HL*1.6*107 start: to fix the multiple lines per segment
+42 ;S LN2=LN2+1,LN1=LN1+1
+43 SET LN2=LN2+1
+44 ;HL*1.6*107 end
+45 QUIT
End DoDot:2
End DoDot:1
+46 SET LN1=.5
+47 SET ^TMP($JOB,"MESSAGE",XXY,LN2,0)="MESSAGE TEXT: "
SET LN2=LN2+1
+48 IF $DATA(^HL(772,XXZ,"IN",0))
Begin DoDot:1
+49 FOR
SET LN1=$ORDER(^HL(772,XXZ,"IN",LN1))
IF (LN1="")
QUIT
Begin DoDot:2
+50 SET ^TMP($JOB,"MESSAGE",XXY,LN2,0)=^HL(772,XXZ,"IN",LN1,0)
+51 ;HL*1.6*107 start: to fix the multiple lines per segment
+52 ;S LN2=LN2+1,LN1=LN1+1
+53 SET LN2=LN2+1
+54 ;HL*1.6*107 end
+55 QUIT
End DoDot:2
End DoDot:1
+56 SET (YY1,YY2)=LN2-1
+57 SET Y1Y2=YY1_"^"_YY2
+58 SET $PIECE(^TMP($JOB,"MESSAGE",XXY,0),U,3,4)=Y1Y2
+59 KILL LN1,LN2,Y1Y2,YY1,YY2
+60 QUIT
+61 ;
HLCSBAR ; Center Title on Top Line of Screen
+1 WRITE RVON,?(80-$LENGTH(HLCSHDR)\2),HLCSHDR,$EXTRACT(SPACE,$X,77),RVOFF,!
+2 QUIT
+3 ;