BLRPCCBD ;IHS/OIT/MKK - IHS TaskMan "Busy Device" Report ;JUL 06, 2010 3:14 PM
;;5.2;IHS LABORATORY;**1025,1027**;NOV 01, 1997
;;
EP ; EP
NEW CNT,CNTTSK,TSK,ONE,ZERO,HEADER,STR,SDATE,STIME
;
S (CNT,CNTTSK,TSK)=0
S HEADER(1)="TASKMAN Listing"
S HEADER(2)="'BUSY DEVICE' Tasks"
S HEADER(3)=" "
S $E(HEADER(4),1)="Task #"
S $E(HEADER(4),13)="Date"
S $E(HEADER(4),21)="Time"
S $E(HEADER(4),31)="Routine"
S $E(HEADER(4),41)="Description"
;
F S TSK=$O(^%ZTSK(TSK)) Q:TSK=""!(TSK'?.N) D
. S CNTTSK=CNTTSK+1
. ;
. ; Only HLLP processes
. I $G(^%ZTSK(TSK,.03))'["HL7 Message Processor for Lab" Q
. ;
. S ONE=$$UP^XLFSTR($G(^%ZTSK(TSK,.1)))
. I ONE'["RESCHEDULED FOR BUSY DEVICE" Q
. ;
. S ZERO=$G(^%ZTSK(TSK,0))
. S SDATE=$$UP^XLFSTR($$HTE^XLFDT($P(ZERO,"^",5),"2PMZ"))
. S STIME=$P(SDATE," ",2,3)
. S SDATE=$P(SDATE," ",1)
. ;
. I CNT<1 D BLRGSHSH^BLRGMENU
. W TSK
. W ?10,SDATE,$J(STIME,9)
. W ?30,$P(ZERO,"^",2)
. W ?40,$E($G(^%ZTSK(TSK,.03)),1,40)
. W !
. S CNT=CNT+1
;
W:CNT>0 !!,"Number of tasks that were rescheduled = ",CNT,!
; W:CNT<1 !!,"Number of tasks that were examined = ",CNTTSK,!
; ----- BEGIN IHS/OIT/MKK LR*5.2*1027 -- More explicit message
I CNT<1 D
. W !!,"Number of tasks that were examined = ",CNTTSK,!
. W ?10,"No Tasks were rescheduled.",!!
; ----- END IHS/OIT/MKK LR*5.2*1027
;
D PRESSKEY^BLRGMENU(10)
;
Q
BLRPCCBD ;IHS/OIT/MKK - IHS TaskMan "Busy Device" Report ;JUL 06, 2010 3:14 PM
+1 ;;5.2;IHS LABORATORY;**1025,1027**;NOV 01, 1997
+2 ;;
EP ; EP
+1 NEW CNT,CNTTSK,TSK,ONE,ZERO,HEADER,STR,SDATE,STIME
+2 ;
+3 SET (CNT,CNTTSK,TSK)=0
+4 SET HEADER(1)="TASKMAN Listing"
+5 SET HEADER(2)="'BUSY DEVICE' Tasks"
+6 SET HEADER(3)=" "
+7 SET $EXTRACT(HEADER(4),1)="Task #"
+8 SET $EXTRACT(HEADER(4),13)="Date"
+9 SET $EXTRACT(HEADER(4),21)="Time"
+10 SET $EXTRACT(HEADER(4),31)="Routine"
+11 SET $EXTRACT(HEADER(4),41)="Description"
+12 ;
+13 FOR
SET TSK=$ORDER(^%ZTSK(TSK))
IF TSK=""!(TSK'?.N)
QUIT
Begin DoDot:1
+14 SET CNTTSK=CNTTSK+1
+15 ;
+16 ; Only HLLP processes
+17 IF $GET(^%ZTSK(TSK,.03))'["HL7 Message Processor for Lab"
QUIT
+18 ;
+19 SET ONE=$$UP^XLFSTR($GET(^%ZTSK(TSK,.1)))
+20 IF ONE'["RESCHEDULED FOR BUSY DEVICE"
QUIT
+21 ;
+22 SET ZERO=$GET(^%ZTSK(TSK,0))
+23 SET SDATE=$$UP^XLFSTR($$HTE^XLFDT($PIECE(ZERO,"^",5),"2PMZ"))
+24 SET STIME=$PIECE(SDATE," ",2,3)
+25 SET SDATE=$PIECE(SDATE," ",1)
+26 ;
+27 IF CNT<1
DO BLRGSHSH^BLRGMENU
+28 WRITE TSK
+29 WRITE ?10,SDATE,$JUSTIFY(STIME,9)
+30 WRITE ?30,$PIECE(ZERO,"^",2)
+31 WRITE ?40,$EXTRACT($GET(^%ZTSK(TSK,.03)),1,40)
+32 WRITE !
+33 SET CNT=CNT+1
End DoDot:1
+34 ;
+35 IF CNT>0
WRITE !!,"Number of tasks that were rescheduled = ",CNT,!
+36 ; W:CNT<1 !!,"Number of tasks that were examined = ",CNTTSK,!
+37 ; ----- BEGIN IHS/OIT/MKK LR*5.2*1027 -- More explicit message
+38 IF CNT<1
Begin DoDot:1
+39 WRITE !!,"Number of tasks that were examined = ",CNTTSK,!
+40 WRITE ?10,"No Tasks were rescheduled.",!!
End DoDot:1
+41 ; ----- END IHS/OIT/MKK LR*5.2*1027
+42 ;
+43 DO PRESSKEY^BLRGMENU(10)
+44 ;
+45 QUIT