HLUOPT5 ;OIFO-O/LJA - Purging Entries in file #772 and #773 ;02/04/2004 16:37
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
;
; This routine was created by patch HL*1.6*109
;
GRAPH ; Display graph for all entries in ^XTMP
N DATA,DATE,END,HOLD,MAX,MULT,START,TXT,TYPE,VAL,XTMP
;
; Create HOLD(...) with entry data, and max values...
S XTMP="HLUOPT1 "
F S XTMP=$O(^XTMP(XTMP)) Q:XTMP'["HLUOPT1 " D
.
. S DATA=$G(^XTMP(XTMP,"RUN")) Q:$P(DATA,U,5)'["FINISHED" ;->
.
. S START=$P(DATA,U,2) QUIT:START'?7N.E ;->
. S END=$P(DATA,U,4) QUIT:END'?7N.E ;->
. S DIFF=$$FMDIFF^XLFDT(END,START,2) ; Hours difference
. D HOLD(1,DIFF)
.
. S DEL772=$P(DATA,U,8)
. D HOLD(2,DEL772)
.
. S DEL773=$P(DATA,U,10)
. D HOLD(3,DEL773)
.
. S HOLD($P(XTMP," ",2))=DIFF_U_DEL772_U_DEL773
;
QUIT:'$D(HOLD) ;->
;
; Calculate graph multiplier...
F TYPE=1,2,3 D
. S MAX=HOLD(TYPE)
. S MULT(TYPE)=MAX/21\1
;
W !,"VistA HL7 Purge Graph"
W !,"Purge-Date | Purge-Time | 772 Deletions | 773 Deletions"
W !,$$REPEAT^XLFSTR("=",IOM)
W !,?12,"| Max Hr = ",$J(HOLD(1)/(3600),0,1)
W ?35,"| Max # = ",$FN(HOLD(2),",")
W ?58,"| Max # = ",$FN(HOLD(3),",")
W !,$$REPEAT^XLFSTR("=",IOM)
;
S DATE=0
F S DATE=$O(HOLD(DATE)) Q:'DATE D
.
. QUIT:DATE'?7N1"."1.N ;->
. S TXT=$$SDT^HLUOPT4(DATE)_" |"
.
. S DATA=HOLD(DATE) ; Get data...
.
. S VAL=$P(DATA,U) ; Time difference...
. D PAD(VAL,21,1)
.
. S VAL=$P(DATA,U,2) ; #772 deleted...
. D PAD(VAL,21,2)
.
. S VAL=$P(DATA,U,3) ; #773 deleted...
. D PAD(VAL,21,3)
.
. W !,TXT
;
Q
;
PAD(NUM,COL,MULTNO) ; Add VAL to TXT...
; TXT -- req
N CHAR
S MULT=MULT(MULTNO)
S CHAR=$S(MULT:$E($$REPEAT^XLFSTR("=",NUM\MULT),1,COL),1:"")
S CHAR=$E(CHAR_$$REPEAT^XLFSTR(" ",COL),1,COL)
S CHAR=CHAR_$S(MULTNO'=3:" |",1:"")
S TXT=TXT_CHAR
Q
;
HOLD(NUM,VAL) ; Update HOLD(#)...
S:'$D(HOLD(NUM)) HOLD(NUM)=VAL
S:VAL>HOLD(NUM) HOLD(NUM)=VAL ; Largest value...
Q
;
GRAPHONE(XTMP) ; Display graph bar for one XTMP entry...
;
Q
;
SHOWALL(XTMP) ; Show all information
N I,ACTIVE,COLNO,CURR,LAST,PCE1,PCE2,PCE3,PCE4,PCE5,PCE6,PCE7
N PCE8,PCE9,PCE10,PCE11,PCE12,PCE13,PCE14,PMT
S COLNO=5
F D Q:'$$BTE(PMT,1,120) Q:'ACTIVE
. S RUN=$G(^XTMP(XTMP,"RUN")) I RUN']"" W " no data..." QUIT ;->
. F I=1:1:16 S CURR(I)=$P(RUN,U,I)
. F I=1:1:16 S @("PCE"_I)=$P(RUN,U,I)
. S PCE2=$$FMTE^XLFDT(PCE2),PCE3=$$FMTE^XLFDT(PCE3),PCE4=$$FMTE^XLFDT(PCE4)
. W !!,$$CJ^XLFSTR(" "_$$FMTE^XLFDT($$NOW^XLFDT)_" ["_XTMP_"] ",IOM,"=")
. W !,$$D(2),?COLNO,"Start time: ",?(COLNO+25),PCE2,$$S(2)
. W !,$$D(3),?COLNO,"Last timestamp: ",?(COLNO+25),PCE3,$$S(3)
. W !,$$D(4),?COLNO,"End time: ",?(COLNO+25),PCE4,$$S(4)
. S PMT=$S(PCE4]"":"Press RETURN to exit... ",1:"Wait 120 seconds for refresh, or enter '^' to exit... ")
. S ACTIVE=$S(PCE4]"":0,1:1) ; Is last job still running?
. W !,$$D(5),?COLNO,"Status: ",?(COLNO+25),$J(PCE5,9),$$S(5,9)
. W !,$$D(6),?COLNO,"Location: ",?(COLNO+25),$J(PCE6,9),$$S(6,9)
. W !,$$D(1),?COLNO,"Task number: ",?(COLNO+25),$J(PCE1,9),$$S(1,9)
. W !,$$REPEAT^XLFSTR("-",IOM)
. W !,$$D(7),?COLNO,"#772 reviewed: ",?(COLNO+25),$J(PCE7,9),$$S(7,9)
. W !,$$D(12),?COLNO,"#772 revw'd w/o purging: ",?(COLNO+25),$J(PCE12,9),$$S(12,9)
. W !,$$D(11),?COLNO,"Last 772 reviewed: ",?(COLNO+25),$J(PCE11,9),$$S(11,9)
. S X=$$D(11) I X']"" W $$SDT^HLUOPT4(PCE15)
. W !,$$D(8),?COLNO,"#772 purged: ",?(COLNO+25),$J(PCE8,9),$$S(8,9)
. W !,$$REPEAT^XLFSTR("-",IOM)
. W !,$$D(9),?COLNO,"#773 reviewed: ",?(COLNO+25),$J(PCE9,9),$$S(9,9)
. W !,$$D(14),?COLNO,"#773 revw'd w/o purging: ",?(COLNO+25),$J(PCE14,9),$$S(14,9)
. W !,$$D(13),?COLNO,"Last 773 reviewed: ",?(COLNO+25),$J(PCE13,9),$$S(13,9)
. S X=$$D(13) I X']"" W $$SDT^HLUOPT4(PCE16)
. W !,$$D(10),?COLNO,"#773 purged: ",?(COLNO+25),$J(PCE10,9),$$S(10,9)
. F I=1:1:14 S LAST(I)=$P(RUN,U,I)
QUIT
;
D(NO) ; Any change since last display?
QUIT:'$D(LAST) "" ;->
QUIT:CURR(NO)=LAST(NO) "" ;->
QUIT "->"
;
S(NO,COL) ; Display previous value....
N TXT
S TXT="",COL=+$G(COL)
QUIT:'$D(LAST) $J("",COL) ;->
QUIT:CURR(NO)=LAST(NO) $J("",COL) ;->
S TXT=$E($$REPEAT^XLFSTR("_",IOM),1,53-$X)
I NO>3 S TXT=TXT_LAST(NO) QUIT $J(TXT,COL) ;->
I LAST(NO)?7N.E W $J(TXT_$$FMTE^XLFDT(LAST(NO)),COL)
QUIT ""
;
BTE(PMT,FF,TIMEOUT) ;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
F X=1:1:$G(FF) W !
S DIR(0)="EA",DIR("A")=PMT
S:$G(TIMEOUT) DIR("T")=TIMEOUT
D ^DIR
QUIT:$D(DUOUT) "" ;->
QUIT $S(Y=1!($D(DIRUT)):1,1:"") ; 1... if RETURN or timeout...
;
EOR ;HLUOPT5 - Purging Entries in file #772 and #773 ;12/10/02 16:37
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLUOPT5 4743 printed Nov 22, 2024@17:10:29 Page 2
HLUOPT5 ;OIFO-O/LJA - Purging Entries in file #772 and #773 ;02/04/2004 16:37
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
+2 ;
+3 ; This routine was created by patch HL*1.6*109
+4 ;
GRAPH ; Display graph for all entries in ^XTMP
+1 NEW DATA,DATE,END,HOLD,MAX,MULT,START,TXT,TYPE,VAL,XTMP
+2 ;
+3 ; Create HOLD(...) with entry data, and max values...
+4 SET XTMP="HLUOPT1 "
+5 FOR
SET XTMP=$ORDER(^XTMP(XTMP))
if XTMP'["HLUOPT1 "
QUIT
Begin DoDot:1
+6 +7 ;->
SET DATA=$GET(^XTMP(XTMP,"RUN"))
if $PIECE(DATA,U,5)'["FINISHED"
QUIT
+8 +9 ;->
SET START=$PIECE(DATA,U,2)
if START'?7N.E
QUIT
+10 ;->
SET END=$PIECE(DATA,U,4)
if END'?7N.E
QUIT
+11 ; Hours difference
SET DIFF=$$FMDIFF^XLFDT(END,START,2)
+12 DO HOLD(1,DIFF)
+13 +14 SET DEL772=$PIECE(DATA,U,8)
+15 DO HOLD(2,DEL772)
+16 +17 SET DEL773=$PIECE(DATA,U,10)
+18 DO HOLD(3,DEL773)
+19 +20 SET HOLD($PIECE(XTMP," ",2))=DIFF_U_DEL772_U_DEL773
End DoDot:1
+21 ;
+22 ;->
if '$DATA(HOLD)
QUIT
+23 ;
+24 ; Calculate graph multiplier...
+25 FOR TYPE=1,2,3
Begin DoDot:1
+26 SET MAX=HOLD(TYPE)
+27 SET MULT(TYPE)=MAX/21\1
End DoDot:1
+28 ;
+29 WRITE !,"VistA HL7 Purge Graph"
+30 WRITE !,"Purge-Date | Purge-Time | 772 Deletions | 773 Deletions"
+31 WRITE !,$$REPEAT^XLFSTR("=",IOM)
+32 WRITE !,?12,"| Max Hr = ",$JUSTIFY(HOLD(1)/(3600),0,1)
+33 WRITE ?35,"| Max # = ",$FNUMBER(HOLD(2),",")
+34 WRITE ?58,"| Max # = ",$FNUMBER(HOLD(3),",")
+35 WRITE !,$$REPEAT^XLFSTR("=",IOM)
+36 ;
+37 SET DATE=0
+38 FOR
SET DATE=$ORDER(HOLD(DATE))
if 'DATE
QUIT
Begin DoDot:1
+39 +40 ;->
if DATE'?7N1"."1.N
QUIT
+41 SET TXT=$$SDT^HLUOPT4(DATE)_" |"
+42 +43 ; Get data...
SET DATA=HOLD(DATE)
+44 +45 ; Time difference...
SET VAL=$PIECE(DATA,U)
+46 DO PAD(VAL,21,1)
+47 +48 ; #772 deleted...
SET VAL=$PIECE(DATA,U,2)
+49 DO PAD(VAL,21,2)
+50 +51 ; #773 deleted...
SET VAL=$PIECE(DATA,U,3)
+52 DO PAD(VAL,21,3)
+53 +54 WRITE !,TXT
End DoDot:1
+55 ;
+56 QUIT
+57 ;
PAD(NUM,COL,MULTNO) ; Add VAL to TXT...
+1 ; TXT -- req
+2 NEW CHAR
+3 SET MULT=MULT(MULTNO)
+4 SET CHAR=$SELECT(MULT:$EXTRACT($$REPEAT^XLFSTR("=",NUM\MULT),1,COL),1:"")
+5 SET CHAR=$EXTRACT(CHAR_$$REPEAT^XLFSTR(" ",COL),1,COL)
+6 SET CHAR=CHAR_$SELECT(MULTNO'=3:" |",1:"")
+7 SET TXT=TXT_CHAR
+8 QUIT
+9 ;
HOLD(NUM,VAL) ; Update HOLD(#)...
+1 if '$DATA(HOLD(NUM))
SET HOLD(NUM)=VAL
+2 ; Largest value...
if VAL>HOLD(NUM)
SET HOLD(NUM)=VAL
+3 QUIT
+4 ;
GRAPHONE(XTMP) ; Display graph bar for one XTMP entry...
+1 ;
+2 QUIT
+3 ;
SHOWALL(XTMP) ; Show all information
+1 NEW I,ACTIVE,COLNO,CURR,LAST,PCE1,PCE2,PCE3,PCE4,PCE5,PCE6,PCE7
+2 NEW PCE8,PCE9,PCE10,PCE11,PCE12,PCE13,PCE14,PMT
+3 SET COLNO=5
+4 FOR
Begin DoDot:1
+5 ;->
SET RUN=$GET(^XTMP(XTMP,"RUN"))
IF RUN']""
WRITE " no data..."
QUIT
+6 FOR I=1:1:16
SET CURR(I)=$PIECE(RUN,U,I)
+7 FOR I=1:1:16
SET @("PCE"_I)=$PIECE(RUN,U,I)
+8 SET PCE2=$$FMTE^XLFDT(PCE2)
SET PCE3=$$FMTE^XLFDT(PCE3)
SET PCE4=$$FMTE^XLFDT(PCE4)
+9 WRITE !!,$$CJ^XLFSTR(" "_$$FMTE^XLFDT($$NOW^XLFDT)_" ["_XTMP_"] ",IOM,"=")
+10 WRITE !,$$D(2),?COLNO,"Start time: ",?(COLNO+25),PCE2,$$S(2)
+11 WRITE !,$$D(3),?COLNO,"Last timestamp: ",?(COLNO+25),PCE3,$$S(3)
+12 WRITE !,$$D(4),?COLNO,"End time: ",?(COLNO+25),PCE4,$$S(4)
+13 SET PMT=$SELECT(PCE4]"":"Press RETURN to exit... ",1:"Wait 120 seconds for refresh, or enter '^' to exit... ")
+14 ; Is last job still running?
SET ACTIVE=$SELECT(PCE4]"":0,1:1)
+15 WRITE !,$$D(5),?COLNO,"Status: ",?(COLNO+25),$JUSTIFY(PCE5,9),$$S(5,9)
+16 WRITE !,$$D(6),?COLNO,"Location: ",?(COLNO+25),$JUSTIFY(PCE6,9),$$S(6,9)
+17 WRITE !,$$D(1),?COLNO,"Task number: ",?(COLNO+25),$JUSTIFY(PCE1,9),$$S(1,9)
+18 WRITE !,$$REPEAT^XLFSTR("-",IOM)
+19 WRITE !,$$D(7),?COLNO,"#772 reviewed: ",?(COLNO+25),$JUSTIFY(PCE7,9),$$S(7,9)
+20 WRITE !,$$D(12),?COLNO,"#772 revw'd w/o purging: ",?(COLNO+25),$JUSTIFY(PCE12,9),$$S(12,9)
+21 WRITE !,$$D(11),?COLNO,"Last 772 reviewed: ",?(COLNO+25),$JUSTIFY(PCE11,9),$$S(11,9)
+22 SET X=$$D(11)
IF X']""
WRITE $$SDT^HLUOPT4(PCE15)
+23 WRITE !,$$D(8),?COLNO,"#772 purged: ",?(COLNO+25),$JUSTIFY(PCE8,9),$$S(8,9)
+24 WRITE !,$$REPEAT^XLFSTR("-",IOM)
+25 WRITE !,$$D(9),?COLNO,"#773 reviewed: ",?(COLNO+25),$JUSTIFY(PCE9,9),$$S(9,9)
+26 WRITE !,$$D(14),?COLNO,"#773 revw'd w/o purging: ",?(COLNO+25),$JUSTIFY(PCE14,9),$$S(14,9)
+27 WRITE !,$$D(13),?COLNO,"Last 773 reviewed: ",?(COLNO+25),$JUSTIFY(PCE13,9),$$S(13,9)
+28 SET X=$$D(13)
IF X']""
WRITE $$SDT^HLUOPT4(PCE16)
+29 WRITE !,$$D(10),?COLNO,"#773 purged: ",?(COLNO+25),$JUSTIFY(PCE10,9),$$S(10,9)
+30 FOR I=1:1:14
SET LAST(I)=$PIECE(RUN,U,I)
End DoDot:1
if '$$BTE(PMT,1,120)
QUIT
if 'ACTIVE
QUIT
+31 QUIT
+32 ;
D(NO) ; Any change since last display?
+1 ;->
if '$DATA(LAST)
QUIT ""
+2 ;->
if CURR(NO)=LAST(NO)
QUIT ""
+3 QUIT "->"
+4 ;
S(NO,COL) ; Display previous value....
+1 NEW TXT
+2 SET TXT=""
SET COL=+$GET(COL)
+3 ;->
if '$DATA(LAST)
QUIT $JUSTIFY("",COL)
+4 ;->
if CURR(NO)=LAST(NO)
QUIT $JUSTIFY("",COL)
+5 SET TXT=$EXTRACT($$REPEAT^XLFSTR("_",IOM),1,53-$X)
+6 ;->
IF NO>3
SET TXT=TXT_LAST(NO)
QUIT $JUSTIFY(TXT,COL)
+7 IF LAST(NO)?7N.E
WRITE $JUSTIFY(TXT_$$FMTE^XLFDT(LAST(NO)),COL)
+8 QUIT ""
+9 ;
BTE(PMT,FF,TIMEOUT) ;
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 FOR X=1:1:$GET(FF)
WRITE !
+3 SET DIR(0)="EA"
SET DIR("A")=PMT
+4 if $GET(TIMEOUT)
SET DIR("T")=TIMEOUT
+5 DO ^DIR
+6 ;->
if $DATA(DUOUT)
QUIT ""
+7 ; 1... if RETURN or timeout...
QUIT $SELECT(Y=1!($DATA(DIRUT)):1,1:"")
+8 ;
EOR ;HLUOPT5 - Purging Entries in file #772 and #773 ;12/10/02 16:37