[613] | 1 | HLUOPT5 ;OIFO-O/LJA - Purging Entries in file #772 and #773 ;02/04/2004 16:37
|
---|
| 2 | ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
|
---|
| 3 | ;
|
---|
| 4 | ; This routine was created by patch HL*1.6*109
|
---|
| 5 | ;
|
---|
| 6 | GRAPH ; Display graph for all entries in ^XTMP
|
---|
| 7 | N DATA,DATE,END,HOLD,MAX,MULT,START,TXT,TYPE,VAL,XTMP
|
---|
| 8 | ;
|
---|
| 9 | ; Create HOLD(...) with entry data, and max values...
|
---|
| 10 | S XTMP="HLUOPT1 "
|
---|
| 11 | F S XTMP=$O(^XTMP(XTMP)) Q:XTMP'["HLUOPT1 " D
|
---|
| 12 | .
|
---|
| 13 | . S DATA=$G(^XTMP(XTMP,"RUN")) Q:$P(DATA,U,5)'["FINISHED" ;->
|
---|
| 14 | .
|
---|
| 15 | . S START=$P(DATA,U,2) QUIT:START'?7N.E ;->
|
---|
| 16 | . S END=$P(DATA,U,4) QUIT:END'?7N.E ;->
|
---|
| 17 | . S DIFF=$$FMDIFF^XLFDT(END,START,2) ; Hours difference
|
---|
| 18 | . D HOLD(1,DIFF)
|
---|
| 19 | .
|
---|
| 20 | . S DEL772=$P(DATA,U,8)
|
---|
| 21 | . D HOLD(2,DEL772)
|
---|
| 22 | .
|
---|
| 23 | . S DEL773=$P(DATA,U,10)
|
---|
| 24 | . D HOLD(3,DEL773)
|
---|
| 25 | .
|
---|
| 26 | . S HOLD($P(XTMP," ",2))=DIFF_U_DEL772_U_DEL773
|
---|
| 27 | ;
|
---|
| 28 | QUIT:'$D(HOLD) ;->
|
---|
| 29 | ;
|
---|
| 30 | ; Calculate graph multiplier...
|
---|
| 31 | F TYPE=1,2,3 D
|
---|
| 32 | . S MAX=HOLD(TYPE)
|
---|
| 33 | . S MULT(TYPE)=MAX/21\1
|
---|
| 34 | ;
|
---|
| 35 | W !,"VistA HL7 Purge Graph"
|
---|
| 36 | W !,"Purge-Date | Purge-Time | 772 Deletions | 773 Deletions"
|
---|
| 37 | W !,$$REPEAT^XLFSTR("=",IOM)
|
---|
| 38 | W !,?12,"| Max Hr = ",$J(HOLD(1)/(3600),0,1)
|
---|
| 39 | W ?35,"| Max # = ",$FN(HOLD(2),",")
|
---|
| 40 | W ?58,"| Max # = ",$FN(HOLD(3),",")
|
---|
| 41 | W !,$$REPEAT^XLFSTR("=",IOM)
|
---|
| 42 | ;
|
---|
| 43 | S DATE=0
|
---|
| 44 | F S DATE=$O(HOLD(DATE)) Q:'DATE D
|
---|
| 45 | .
|
---|
| 46 | . QUIT:DATE'?7N1"."1.N ;->
|
---|
| 47 | . S TXT=$$SDT^HLUOPT4(DATE)_" |"
|
---|
| 48 | .
|
---|
| 49 | . S DATA=HOLD(DATE) ; Get data...
|
---|
| 50 | .
|
---|
| 51 | . S VAL=$P(DATA,U) ; Time difference...
|
---|
| 52 | . D PAD(VAL,21,1)
|
---|
| 53 | .
|
---|
| 54 | . S VAL=$P(DATA,U,2) ; #772 deleted...
|
---|
| 55 | . D PAD(VAL,21,2)
|
---|
| 56 | .
|
---|
| 57 | . S VAL=$P(DATA,U,3) ; #773 deleted...
|
---|
| 58 | . D PAD(VAL,21,3)
|
---|
| 59 | .
|
---|
| 60 | . W !,TXT
|
---|
| 61 | ;
|
---|
| 62 | Q
|
---|
| 63 | ;
|
---|
| 64 | PAD(NUM,COL,MULTNO) ; Add VAL to TXT...
|
---|
| 65 | ; TXT -- req
|
---|
| 66 | N CHAR
|
---|
| 67 | S MULT=MULT(MULTNO)
|
---|
| 68 | S CHAR=$S(MULT:$E($$REPEAT^XLFSTR("=",NUM\MULT),1,COL),1:"")
|
---|
| 69 | S CHAR=$E(CHAR_$$REPEAT^XLFSTR(" ",COL),1,COL)
|
---|
| 70 | S CHAR=CHAR_$S(MULTNO'=3:" |",1:"")
|
---|
| 71 | S TXT=TXT_CHAR
|
---|
| 72 | Q
|
---|
| 73 | ;
|
---|
| 74 | HOLD(NUM,VAL) ; Update HOLD(#)...
|
---|
| 75 | S:'$D(HOLD(NUM)) HOLD(NUM)=VAL
|
---|
| 76 | S:VAL>HOLD(NUM) HOLD(NUM)=VAL ; Largest value...
|
---|
| 77 | Q
|
---|
| 78 | ;
|
---|
| 79 | GRAPHONE(XTMP) ; Display graph bar for one XTMP entry...
|
---|
| 80 | ;
|
---|
| 81 | Q
|
---|
| 82 | ;
|
---|
| 83 | SHOWALL(XTMP) ; Show all information
|
---|
| 84 | N I,ACTIVE,COLNO,CURR,LAST,PCE1,PCE2,PCE3,PCE4,PCE5,PCE6,PCE7
|
---|
| 85 | N PCE8,PCE9,PCE10,PCE11,PCE12,PCE13,PCE14,PMT
|
---|
| 86 | S COLNO=5
|
---|
| 87 | F D Q:'$$BTE(PMT,1,120) Q:'ACTIVE
|
---|
| 88 | . S RUN=$G(^XTMP(XTMP,"RUN")) I RUN']"" W " no data..." QUIT ;->
|
---|
| 89 | . F I=1:1:16 S CURR(I)=$P(RUN,U,I)
|
---|
| 90 | . F I=1:1:16 S @("PCE"_I)=$P(RUN,U,I)
|
---|
| 91 | . S PCE2=$$FMTE^XLFDT(PCE2),PCE3=$$FMTE^XLFDT(PCE3),PCE4=$$FMTE^XLFDT(PCE4)
|
---|
| 92 | . W !!,$$CJ^XLFSTR(" "_$$FMTE^XLFDT($$NOW^XLFDT)_" ["_XTMP_"] ",IOM,"=")
|
---|
| 93 | . W !,$$D(2),?COLNO,"Start time: ",?(COLNO+25),PCE2,$$S(2)
|
---|
| 94 | . W !,$$D(3),?COLNO,"Last timestamp: ",?(COLNO+25),PCE3,$$S(3)
|
---|
| 95 | . W !,$$D(4),?COLNO,"End time: ",?(COLNO+25),PCE4,$$S(4)
|
---|
| 96 | . S PMT=$S(PCE4]"":"Press RETURN to exit... ",1:"Wait 120 seconds for refresh, or enter '^' to exit... ")
|
---|
| 97 | . S ACTIVE=$S(PCE4]"":0,1:1) ; Is last job still running?
|
---|
| 98 | . W !,$$D(5),?COLNO,"Status: ",?(COLNO+25),$J(PCE5,9),$$S(5,9)
|
---|
| 99 | . W !,$$D(6),?COLNO,"Location: ",?(COLNO+25),$J(PCE6,9),$$S(6,9)
|
---|
| 100 | . W !,$$D(1),?COLNO,"Task number: ",?(COLNO+25),$J(PCE1,9),$$S(1,9)
|
---|
| 101 | . W !,$$REPEAT^XLFSTR("-",IOM)
|
---|
| 102 | . W !,$$D(7),?COLNO,"#772 reviewed: ",?(COLNO+25),$J(PCE7,9),$$S(7,9)
|
---|
| 103 | . W !,$$D(12),?COLNO,"#772 revw'd w/o purging: ",?(COLNO+25),$J(PCE12,9),$$S(12,9)
|
---|
| 104 | . W !,$$D(11),?COLNO,"Last 772 reviewed: ",?(COLNO+25),$J(PCE11,9),$$S(11,9)
|
---|
| 105 | . S X=$$D(11) I X']"" W $$SDT^HLUOPT4(PCE15)
|
---|
| 106 | . W !,$$D(8),?COLNO,"#772 purged: ",?(COLNO+25),$J(PCE8,9),$$S(8,9)
|
---|
| 107 | . W !,$$REPEAT^XLFSTR("-",IOM)
|
---|
| 108 | . W !,$$D(9),?COLNO,"#773 reviewed: ",?(COLNO+25),$J(PCE9,9),$$S(9,9)
|
---|
| 109 | . W !,$$D(14),?COLNO,"#773 revw'd w/o purging: ",?(COLNO+25),$J(PCE14,9),$$S(14,9)
|
---|
| 110 | . W !,$$D(13),?COLNO,"Last 773 reviewed: ",?(COLNO+25),$J(PCE13,9),$$S(13,9)
|
---|
| 111 | . S X=$$D(13) I X']"" W $$SDT^HLUOPT4(PCE16)
|
---|
| 112 | . W !,$$D(10),?COLNO,"#773 purged: ",?(COLNO+25),$J(PCE10,9),$$S(10,9)
|
---|
| 113 | . F I=1:1:14 S LAST(I)=$P(RUN,U,I)
|
---|
| 114 | QUIT
|
---|
| 115 | ;
|
---|
| 116 | D(NO) ; Any change since last display?
|
---|
| 117 | QUIT:'$D(LAST) "" ;->
|
---|
| 118 | QUIT:CURR(NO)=LAST(NO) "" ;->
|
---|
| 119 | QUIT "->"
|
---|
| 120 | ;
|
---|
| 121 | S(NO,COL) ; Display previous value....
|
---|
| 122 | N TXT
|
---|
| 123 | S TXT="",COL=+$G(COL)
|
---|
| 124 | QUIT:'$D(LAST) $J("",COL) ;->
|
---|
| 125 | QUIT:CURR(NO)=LAST(NO) $J("",COL) ;->
|
---|
| 126 | S TXT=$E($$REPEAT^XLFSTR("_",IOM),1,53-$X)
|
---|
| 127 | I NO>3 S TXT=TXT_LAST(NO) QUIT $J(TXT,COL) ;->
|
---|
| 128 | I LAST(NO)?7N.E W $J(TXT_$$FMTE^XLFDT(LAST(NO)),COL)
|
---|
| 129 | QUIT ""
|
---|
| 130 | ;
|
---|
| 131 | BTE(PMT,FF,TIMEOUT) ;
|
---|
| 132 | N DIR,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 133 | F X=1:1:$G(FF) W !
|
---|
| 134 | S DIR(0)="EA",DIR("A")=PMT
|
---|
| 135 | S:$G(TIMEOUT) DIR("T")=TIMEOUT
|
---|
| 136 | D ^DIR
|
---|
| 137 | QUIT:$D(DUOUT) "" ;->
|
---|
| 138 | QUIT $S(Y=1!($D(DIRUT)):1,1:"") ; 1... if RETURN or timeout...
|
---|
| 139 | ;
|
---|
| 140 | EOR ;HLUOPT5 - Purging Entries in file #772 and #773 ;12/10/02 16:37
|
---|