BOPTBS ;IHS/ILC/ALG/CIA/PLS - troubleshooting ;13-Apr-2006 10:18;SM
;;1.0;AUTOMATED DISPENSING INTERFACE;**1**;Jul 26, 2005
;EP - Called by BOP FUTURE TASK LIST option
C S (BOPOXX,BOPOX)="BOP"
;
FUT ;Searching Future tasks.
N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS
K ^TMP($J)
S ZTC=0,ZTF=1,ZTH="Scheduled and waiting tasks..."
W !!,"Building sorted list of tasks..."
;
F1 S ZT1="" F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" D
.S ZT2="" F S ZT2=$O(^%ZTSCH("JOB",ZT1,ZT2)) Q:'ZT2 D
..D SORT(ZT1,ZT2)
;
F2 S ZT1=$$H3^%ZTM($H) F S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 D
.S ZTS=0 F S ZTS=$O(^%ZTSCH(ZT1,ZTS)) Q:'ZTS D
..D SORT(ZT1,ZTS)
;
F3 S ZT1="" F S ZT1=$O(^%ZTSCH("IO",ZT1)) Q:ZT1="" D
.S ZT2="" F S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)) Q:'ZT2 D
..S ZT3=0 F S ZT3=$O(^%ZTSCH("IO",ZT1,ZT2,ZT3)) Q:ZT3="" D
...D SORT(ZT2,ZT3)
;
F4 S ZT1="" F S ZT1=$O(^%ZTSCH("LINK",ZT1)) Q:'ZT1 D
.S ZT2="" F S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:'ZT2 D
..S ZTS=0 F S ZTS=$O(^%ZTSCH("LINK",ZT1,ZT2,ZTS)) Q:'ZTS D
...D SORT(ZT2,ZTS)
W "finished!"
F5 ;
G:$O(^TMP($J,0))="" F6
S BOPOERR=0
S BOPOI=0 F S BOPOI=$O(^TMP($J,BOPOI)) Q:BOPOI="" S BOPOJ=0 F S BOPOJ=$O(^TMP($J,BOPOI,BOPOJ)) Q:BOPOJ="" D
.S DATA=$G(^%ZTSK(BOPOJ,0)) I $P(DATA,"^",2)[BOPOX D
..S BOPOERR=1
..F I=1:1:10 S BOPOE(I)=$P(DATA,"^",I)
..F I=5,6 S BOPOF(I)=$$HTE^XLFDT(BOPOE(I),"2Z")
..W !,"Task No. ",BOPOJ
..W !,"Routine: ",BOPOE(2)
..W !,"Creation time: ",BOPOF(5)
..W !,"Sched. Run Time: ",BOPOF(6)
..W !,"Scheduled by: ",BOPOE(10)
..W !
I 'BOPOERR W !!,"No future task scheduled for "_BOPOX
K ^TMP($J)
Q
;
F6 I 'ZTC W !!,"There are no future tasks on this volume set."
W ! S DIR(0)="E",DIR("A")="Press RETURN to continue" D
.I ZTC S DIR("A")="End of listing. "_DIR("A")
D ^DIR K ^TMP($J) Q
;
SORT(ZTDTH,ZTSK) ;
I ZTDTH["," S ZTDTH=$$H3^%ZTM(ZTDTH)
S ^TMP($J,ZTDTH,ZTSK)=""
Q
;
BOPOR ; EP - troubleshoot menu option
;Called by BOP RUN TASK LIST option
S BOPOI=0,BOPOJ=0
S BOPOII="Info from running task file: "
F S BOPOI=$O(^%ZTSCH("TASK",BOPOI)) Q:BOPOI<1 D
.Q:'$D(^%ZTSK(BOPOI))
.S DATA=^%ZTSK(BOPOI,0)
.I $P(DATA,"^",2)["BOP" D BOPOP
W !!
I 'BOPOJ D
.S BOPOII="Info from the Site Parameter file: "
.S ZTSK=$P($G(^BOP(90355,1,4)),"^",3)
.I 'ZTSK Q
.D STAT^%ZTLOAD I $G(ZTSK(0)),$G(ZTSK(1))=1 S BOPOI=ZTSK,DATA=^%ZTSK(BOPOI,0) D BOPOP
S BOPOII=""
I 'BOPOJ W !!!,"There is no running task in ""BOP"" namespace."
Q
BOPOP ;
W !,BOPOII
W !,"The running task is scheduled....",!
S BOPOJ=1
W !,"Task No. ",BOPOI
W !,"Routine: ",$P(DATA,U,2)
W !,"Creation time: ",$$HTE^XLFDT($P(DATA,U,5),"2Z")
W !,"Sched. Run Time: ",$$HTE^XLFDT($P(DATA,U,6),"2Z")
W !,"Scheduled by: ",$P(DATA,U,10)
W !
Q
;
DONE ;EP - Look at the last entry that is done
;Called by BOP CHECK TRANSACTIONS option
N BOPOI,ANS,BOPOX
S BOPOX=0
W !,"Print out the last entry in the log 10 times. This number should change."
W !,"If it doesn't, the interface isn't moving data."
W !,"To stop before 10 cycles are done, enter any number."
W !!,"IEN #",?11,"Patient",?38,"SSN",?44,"Log in date/time"
W !,"-----",?11,"-------",?38,"---",?44,"----------------"
F I=1:1:10 H 2 S BOPOI=^BOP(90355.1,0) S BOPOI=$O(^BOP(90355.1,"AS",0,0)) D Q:'BOPOI D:I=10 REMOVE Q:BOPOX
.I 'BOPOI W !,"NO DATA TO TRANSFER" Q
.W !,BOPOI,?11,$E($P(^BOP(90355.1,BOPOI,1),U,3),1,25),?38,$E($P(^(1),U,15),6,9),?44,$P(^(0),U)
.W ! S DIR(0)="NO",DIR("T")=1 D ^DIR K DIR
.I X?.N D REMOVE
Q
;
REMOVE ;remove an "AS" record
N BOPMGRP
S BOPWHO=$$INTFACE^BOPTU(1) S BOPWHO=$S(BOPWHO="O":"OMNICELL",1:"PYXIS")
N DIR,X,Y S DIR("A")="Do you want to remove this ""AS"" cross reference from this file"
S DIR(0)="YO",DIR("B")="YES"
S DIR("?")=" "
S DIR("?",1)="Enter YES to remove crossreference"
S DIR("?",2)="Enter NO to retain crossreference"
S DIR("?",3)="Enter an '^' to exit."
D ^DIR
S:$G(DUOUT)!$G(DTOUT) BOPOX=1 I 'Y W !,"No changes made" Q
I Y K ^BOP(90355.1,"AS",0,BOPOI) W !,"DONE. Sending a "_$G(BOPWHO)_" Alert notice" D
.S BOPMGRP=$$GET1^DIQ(90355,1,.06)
.I BOPMGRP="" D
..S XMY(DUZ)=""
.E D
..S XMY("G."_BOPMGRP)=""
.;send mail message
.N TEXT,XMTEXT,XMY,XMSUB,XMZ,TEXT
.S XMDUZ="ADS INTERFACE"
.S TEXT(1)="The ""AS"" cross-reference for the following BOP Queue file (90355.1)"
.S TEXT(2)="has been deleted. Please examine the record data."
.S TEXT(3)=BOPOI_" "_$E($P(^BOP(90355.1,BOPOI,1),U,3),1,25)_" "_$E($P(^(1),U,15),6,9)_" "_$P(^(0),U)
.S XMTEXT="TEXT(",XMSUB=$G(BOPWHO)_" Record Fault" D ^XMD
Q
BOPTBS ;IHS/ILC/ALG/CIA/PLS - troubleshooting ;13-Apr-2006 10:18;SM
+1 ;;1.0;AUTOMATED DISPENSING INTERFACE;**1**;Jul 26, 2005
+2 ;EP - Called by BOP FUTURE TASK LIST option
C SET (BOPOXX,BOPOX)="BOP"
+1 ;
FUT ;Searching Future tasks.
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS
+2 KILL ^TMP($JOB)
+3 SET ZTC=0
SET ZTF=1
SET ZTH="Scheduled and waiting tasks..."
+4 WRITE !!,"Building sorted list of tasks..."
+5 ;
F1 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("JOB",ZT1))
IF ZT1=""
QUIT
Begin DoDot:1
+1 SET ZT2=""
FOR
SET ZT2=$ORDER(^%ZTSCH("JOB",ZT1,ZT2))
IF 'ZT2
QUIT
Begin DoDot:2
+2 DO SORT(ZT1,ZT2)
End DoDot:2
End DoDot:1
+3 ;
F2 SET ZT1=$$H3^%ZTM($HOROLOG)
FOR
SET ZT1=$ORDER(^%ZTSCH(ZT1))
IF 'ZT1
QUIT
Begin DoDot:1
+1 SET ZTS=0
FOR
SET ZTS=$ORDER(^%ZTSCH(ZT1,ZTS))
IF 'ZTS
QUIT
Begin DoDot:2
+2 DO SORT(ZT1,ZTS)
End DoDot:2
End DoDot:1
+3 ;
F3 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("IO",ZT1))
IF ZT1=""
QUIT
Begin DoDot:1
+1 SET ZT2=""
FOR
SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
IF 'ZT2
QUIT
Begin DoDot:2
+2 SET ZT3=0
FOR
SET ZT3=$ORDER(^%ZTSCH("IO",ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
Begin DoDot:3
+3 DO SORT(ZT2,ZT3)
End DoDot:3
End DoDot:2
End DoDot:1
+4 ;
F4 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("LINK",ZT1))
IF 'ZT1
QUIT
Begin DoDot:1
+1 SET ZT2=""
FOR
SET ZT2=$ORDER(^%ZTSCH("LINK",ZT1,ZT2))
IF 'ZT2
QUIT
Begin DoDot:2
+2 SET ZTS=0
FOR
SET ZTS=$ORDER(^%ZTSCH("LINK",ZT1,ZT2,ZTS))
IF 'ZTS
QUIT
Begin DoDot:3
+3 DO SORT(ZT2,ZTS)
End DoDot:3
End DoDot:2
End DoDot:1
+4 WRITE "finished!"
F5 ;
+1 IF $ORDER(^TMP($JOB,0))=""
GOTO F6
+2 SET BOPOERR=0
+3 SET BOPOI=0
FOR
SET BOPOI=$ORDER(^TMP($JOB,BOPOI))
IF BOPOI=""
QUIT
SET BOPOJ=0
FOR
SET BOPOJ=$ORDER(^TMP($JOB,BOPOI,BOPOJ))
IF BOPOJ=""
QUIT
Begin DoDot:1
+4 SET DATA=$GET(^%ZTSK(BOPOJ,0))
IF $PIECE(DATA,"^",2)[BOPOX
Begin DoDot:2
+5 SET BOPOERR=1
+6 FOR I=1:1:10
SET BOPOE(I)=$PIECE(DATA,"^",I)
+7 FOR I=5,6
SET BOPOF(I)=$$HTE^XLFDT(BOPOE(I),"2Z")
+8 WRITE !,"Task No. ",BOPOJ
+9 WRITE !,"Routine: ",BOPOE(2)
+10 WRITE !,"Creation time: ",BOPOF(5)
+11 WRITE !,"Sched. Run Time: ",BOPOF(6)
+12 WRITE !,"Scheduled by: ",BOPOE(10)
+13 WRITE !
End DoDot:2
End DoDot:1
+14 IF 'BOPOERR
WRITE !!,"No future task scheduled for "_BOPOX
+15 KILL ^TMP($JOB)
+16 QUIT
+17 ;
F6 IF 'ZTC
WRITE !!,"There are no future tasks on this volume set."
+1 WRITE !
SET DIR(0)="E"
SET DIR("A")="Press RETURN to continue"
Begin DoDot:1
+2 IF ZTC
SET DIR("A")="End of listing. "_DIR("A")
End DoDot:1
+3 DO ^DIR
KILL ^TMP($JOB)
QUIT
+4 ;
SORT(ZTDTH,ZTSK) ;
+1 IF ZTDTH[","
SET ZTDTH=$$H3^%ZTM(ZTDTH)
+2 SET ^TMP($JOB,ZTDTH,ZTSK)=""
+3 QUIT
+4 ;
BOPOR ; EP - troubleshoot menu option
+1 ;Called by BOP RUN TASK LIST option
+2 SET BOPOI=0
SET BOPOJ=0
+3 SET BOPOII="Info from running task file: "
+4 FOR
SET BOPOI=$ORDER(^%ZTSCH("TASK",BOPOI))
IF BOPOI<1
QUIT
Begin DoDot:1
+5 IF '$DATA(^%ZTSK(BOPOI))
QUIT
+6 SET DATA=^%ZTSK(BOPOI,0)
+7 IF $PIECE(DATA,"^",2)["BOP"
DO BOPOP
End DoDot:1
+8 WRITE !!
+9 IF 'BOPOJ
Begin DoDot:1
+10 SET BOPOII="Info from the Site Parameter file: "
+11 SET ZTSK=$PIECE($GET(^BOP(90355,1,4)),"^",3)
+12 IF 'ZTSK
QUIT
+13 DO STAT^%ZTLOAD
IF $GET(ZTSK(0))
IF $GET(ZTSK(1))=1
SET BOPOI=ZTSK
SET DATA=^%ZTSK(BOPOI,0)
DO BOPOP
End DoDot:1
+14 SET BOPOII=""
+15 IF 'BOPOJ
WRITE !!!,"There is no running task in ""BOP"" namespace."
+16 QUIT
BOPOP ;
+1 WRITE !,BOPOII
+2 WRITE !,"The running task is scheduled....",!
+3 SET BOPOJ=1
+4 WRITE !,"Task No. ",BOPOI
+5 WRITE !,"Routine: ",$PIECE(DATA,U,2)
+6 WRITE !,"Creation time: ",$$HTE^XLFDT($PIECE(DATA,U,5),"2Z")
+7 WRITE !,"Sched. Run Time: ",$$HTE^XLFDT($PIECE(DATA,U,6),"2Z")
+8 WRITE !,"Scheduled by: ",$PIECE(DATA,U,10)
+9 WRITE !
+10 QUIT
+11 ;
DONE ;EP - Look at the last entry that is done
+1 ;Called by BOP CHECK TRANSACTIONS option
+2 NEW BOPOI,ANS,BOPOX
+3 SET BOPOX=0
+4 WRITE !,"Print out the last entry in the log 10 times. This number should change."
+5 WRITE !,"If it doesn't, the interface isn't moving data."
+6 WRITE !,"To stop before 10 cycles are done, enter any number."
+7 WRITE !!,"IEN #",?11,"Patient",?38,"SSN",?44,"Log in date/time"
+8 WRITE !,"-----",?11,"-------",?38,"---",?44,"----------------"
+9 FOR I=1:1:10
HANG 2
SET BOPOI=^BOP(90355.1,0)
SET BOPOI=$ORDER(^BOP(90355.1,"AS",0,0))
Begin DoDot:1
+10 IF 'BOPOI
WRITE !,"NO DATA TO TRANSFER"
QUIT
+11 WRITE !,BOPOI,?11,$EXTRACT($PIECE(^BOP(90355.1,BOPOI,1),U,3),1,25),?38,$EXTRACT($PIECE(^(1),U,15),6,9),?44,$PIECE(^(0),U)
+12 WRITE !
SET DIR(0)="NO"
SET DIR("T")=1
DO ^DIR
KILL DIR
+13 IF X?.N
DO REMOVE
End DoDot:1
IF 'BOPOI
QUIT
IF I=10
DO REMOVE
IF BOPOX
QUIT
+14 QUIT
+15 ;
REMOVE ;remove an "AS" record
+1 NEW BOPMGRP
+2 SET BOPWHO=$$INTFACE^BOPTU(1)
SET BOPWHO=$SELECT(BOPWHO="O":"OMNICELL",1:"PYXIS")
+3 NEW DIR,X,Y
SET DIR("A")="Do you want to remove this ""AS"" cross reference from this file"
+4 SET DIR(0)="YO"
SET DIR("B")="YES"
+5 SET DIR("?")=" "
+6 SET DIR("?",1)="Enter YES to remove crossreference"
+7 SET DIR("?",2)="Enter NO to retain crossreference"
+8 SET DIR("?",3)="Enter an '^' to exit."
+9 DO ^DIR
+10 IF $GET(DUOUT)!$GET(DTOUT)
SET BOPOX=1
IF 'Y
WRITE !,"No changes made"
QUIT
+11 IF Y
KILL ^BOP(90355.1,"AS",0,BOPOI)
WRITE !,"DONE. Sending a "_$GET(BOPWHO)_" Alert notice"
Begin DoDot:1
+12 SET BOPMGRP=$$GET1^DIQ(90355,1,.06)
+13 IF BOPMGRP=""
Begin DoDot:2
+14 SET XMY(DUZ)=""
End DoDot:2
+15 IF '$TEST
Begin DoDot:2
+16 SET XMY("G."_BOPMGRP)=""
End DoDot:2
+17 ;send mail message
+18 NEW TEXT,XMTEXT,XMY,XMSUB,XMZ,TEXT
+19 SET XMDUZ="ADS INTERFACE"
+20 SET TEXT(1)="The ""AS"" cross-reference for the following BOP Queue file (90355.1)"
+21 SET TEXT(2)="has been deleted. Please examine the record data."
+22 SET TEXT(3)=BOPOI_" "_$EXTRACT($PIECE(^BOP(90355.1,BOPOI,1),U,3),1,25)_" "_$EXTRACT($PIECE(^(1),U,15),6,9)_" "_$PIECE(^(0),U)
+23 SET XMTEXT="TEXT("
SET XMSUB=$GET(BOPWHO)_" Record Fault"
DO ^XMD
End DoDot:1
+24 QUIT