BQISYSIT ;APTIV/HC/ALA-System Site Parameters for iCare ; 11 Apr 2008 3:43 PM
;;2.7;ICARE MANAGEMENT SYSTEM;**1**;Dec 19, 2017;Build 12
;
GET(DATA,FAKE) ;EP -- BQI GET SYSTEM PARAMETERS
; Get specific iCare system parameters from the Site Parameter file
NEW UID,II,NUM,IEN
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQISYSIT",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010NUM_CONN"_$C(30)
;
S IEN=$$SPM^BQIGPUTL()
S NUM=$$GET1^DIQ(90508,IEN_",",.19,"E") S:NUM="" NUM=3
S II=II+1,@DATA@(II)=NUM_$C(30)
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
ERR ;
D ^%ZTER
NEW Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
Q
;
JOB(DATA,FAKE) ; EP - BQI GET SYSTEM JOB DATA
NEW UID,II,NUM,IEN,OPTN,JOB,FLDS,BQSCHED,BQI,SDATA,TYPE,START,FROM,THRU
NEW END,STAT,OPN,TYP,TASK,TSK,BQNSCH
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQISYSIT",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00015JOB^T00015TYPE^D00030START^D00030END^T00015STATUS^T00050NEXT_DUE"_$C(30)
;
S IEN=$$SPM^BQIGPUTL(),BQSCHED=""
S OPTN=$$FIND^BQISCHED("BQI NIGHTLY BACKGROUND")
I $O(^DIC(19.2,"B",OPTN,""))="" S BQSCHED="Not scheduled"
S JOB="NIGHTLY"
S FLDS="Flags;3.01;3.02;3.03^Natl Measures;3.07;3.08;3.09^Diagnostic Tags;3.04;3.05;3.06^Reminders;3.1;3.11;3.12^Best Practice Prompts;3.13;3.14;"
S FLDS=FLDS_"3.15^Comm Alerts;3.16;3.17;3.18^Panel Autopopulate;3.19;3.2;3.21^Care Mgmt Update;3.22;3.23;3.24" D RET
; CMET
S START=$$FMTE^BQIUL1($P(^BTPW(90628,IEN,0),U,6))
S END=$$FMTE^BQIUL1($P(^BTPW(90628,IEN,0),U,7))
S STAT=$$GET1^DIQ(90628,IEN_",",.08,"E")
S TASK=24.11,TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E") I TSK'="" S STAT=$$TSK(TSK)
S II=II+1,@DATA@(II)=JOB_U_"CMET Data Mining"_U_START_U_END_U_STAT_U_BQSCHED_$C(30)
;
S OPTN=$$FIND^BQISCHED("BQI UPDATE TASK")
I $O(^DIC(19.2,"B",OPTN,""))="" S BQSCHED="Not scheduled"
S JOB="WEEKLY",FLDS="Diagnostic Tags;4.01;4.02;4.03;24.04^Natl Measures;4.04;4.05;4.06;24.05^Reminders;4.07;4.08;4.09;24.06^Best Practice Prompts;4.1;4.11;4.12;24.02" D RET
S JOB="WEEKLY",FLDS="Care Mgmt Update;4.13;4.14;4.15;24.03^IPC;8.04;8.05;8.06;11.06" D RET
;
S JOB="MONTHLY",FLDS="IPC Update;8.1;8.11;8.12;24.08" D RET
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
RET ; Retrieve data
F BQI=1:1:$L(FLDS,"^") D
. S SDATA=$P(FLDS,"^",BQI)
. S TYP=$P(SDATA,";",1),FROM=$P(SDATA,";",2),THRU=$P(SDATA,";",3),STAT=$P(SDATA,";",4),TASK=$P(SDATA,";",5)
. S START=$$FMTE^BQIUL1($$GET1^DIQ(90508,IEN_",",FROM,"I"))
. S END=$$FMTE^BQIUL1($$GET1^DIQ(90508,IEN_",",THRU,"I"))
. S STAT=$$GET1^DIQ(90508,IEN_",",STAT,"E"),BQSCHED=""
. S TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E") I TSK'="" S STAT=$$TSK(TSK)
. I JOB="NIGHTLY" D
.. I STAT'="" S TASK=24.01,TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E") I TSK'="" S STAT=$$TSK(TSK)
.. S OPTN=$$FIND^BQISCHED("BQI NIGHTLY BACKGROUND")
.. I OPTN'>0 S BQSCHED="Not scheduled" Q
.. S OPN=$O(^DIC(19.2,"B",OPTN,""))
.. I OPN="" S BQSCHED="Not scheduled" Q
.. S BQSCHED=$$FMTE^BQIUL1($P(^DIC(19.2,OPN,0),U,2)),BQNSCH=$P(^DIC(19.2,OPN,0),U,2)
. I JOB="WEEKLY" D
.. I TYP="Diagnostic Tags"!(TYP="Natl Measures") D
... S OPTN=$$FIND^BQISCHED("BQI UPDATE TASK")
... I OPTN'>0 S BQSCHED="Not scheduled" Q
... S OPN=$O(^DIC(19.2,"B",OPTN,""))
... I OPN="" S BQSCHED="Not scheduled" Q
... S BQSCHED=$$FMTE^BQIUL1($P(^DIC(19.2,OPN,0),U,2))
.. I TYP="Reminders" D OPRET("BQI UPDATE ALL REMINDERS")
.. I TYP="Best Practice Prompts" D OPRET("BQI UPDATE TREATMENT")
.. I TYP="Care Mgmt Update" D OPRET("BQI UPDATE CARE MGMT")
.. I TYP="IPC" D
... NEW CDOW,DFL,WDATE
... S CDOW=$$DOW^XLFDT(DT,1) I CDOW'=0 D
... S DFL=0
... F I=1:1 Q:DFL D Q:DFL
.... S WDATE=$$FMADD^XLFDT(DT,+I),CDOW=$$DOW^XLFDT(WDATE,1)
.... I CDOW=0 S DFL=1,BQSCHED=WDATE_"."_$P($P($G(^BQI(90508,1,4)),"^",19),".",2),BQSCHED=$$FMTE^BQIUL1(BQSCHED)
. ;
. I JOB="MONTHLY" D
.. I TYP="MU Clinical Quality" D
... NEW ZTSK
... S ZTSK=$P(^BQI(90508,1,12),U,5) I ZTSK'="" D QTSK(ZTSK) Q
... I ZTSK="" D NXRUN("01") Q
.. I TYP="MU Performance" D
... NEW ZTSK
... S ZTSK=$P(^BQI(90508,1,12),U,6) I ZTSK'="" D QTSK(ZTSK) Q
... I ZTSK="" D NXRUN("01")
.. I TYP="IPC Update" D
... NEW DY
... S DY=$P(^BQI(90508,1,11),U,2)
... D NXRUN("0"_DY) Q
. S II=II+1,@DATA@(II)=JOB_U_TYP_U_START_U_END_U_STAT_U_BQSCHED_$C(30)
Q
;
PTCH(DATA,PATCH) ;EP - BQI CHECK PATCH STATUS
; Input parameter
; PATCH - Standard KIDS patch format e.g. BQI*1.1*2 or BGP*8.0*2
NEW UID,II,RESULT,MSG
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQISYPTCH",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010RESULT^T00100MSG"_$C(30)
S RESULT=$$PATCH^XPDUTL(PATCH)
I RESULT=0 S RESULT=-1,MSG="Patch is not installed"
S II=II+1,@DATA@(II)=RESULT_"^"_$G(MSG)_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
;
VRCH(DATA,PKG) ; EP - BQI CHECK VERSION STATUS
; Input parameter
; PKG - Standard Package namespace e.g. BQI or BGP.
NEW UID,II,RESULT
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQISYVRCH",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00010VERSION"_$C(30)
S RESULT=$$VERSION^XPDUTL(PKG)
S II=II+1,@DATA@(II)=RESULT_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
;
JTIP(DATA,FAKE) ;EP - BQI GET JOB TOOLTIPS
NEW UID,II,BQIDA,TDTA,PC,ND,TEXT,NN,TXT
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQISYSTP",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T01024JOB^T01024TYPE^T01024END^T01024START^T01024STATUS^T01024NEXT_DUE"_$C(30)
;
S BQIDA=$$SPM^BQIGPUTL(),II=II+1
; Process the word-processing tooltips
F TDTA="5,1","6,2","7,3" D JTXT
;
F PC=1:1:3 S $P(@DATA@(II),U,(PC+3))=$P(^BQI(90508,BQIDA,8),U,PC)
S @DATA@(II)=@DATA@(II)_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
;
JTXT ;
S ND=$P(TDTA,",",1),PC=$P(TDTA,",",2)
S TEXT="",NN=0
F S NN=$O(^BQI(90508,BQIDA,ND,NN)) Q:'NN D
. S TXT=^BQI(90508,BQIDA,ND,NN,0)
. S TEXT=TEXT_TXT_$C(10)
S $P(@DATA@(II),U,PC)=$$TKO^BQIUL1(TEXT,$C(10))
Q
;
OPRET(RPC) ;EP
S OPTN=$$FIND^BQISCHED(RPC)
I OPTN'>0 S BQSCHED="Not scheduled" Q
S OPN=$O(^DIC(19.2,"B",OPTN,""))
I OPN="" S BQSCHED="Not scheduled" Q
S BQSCHED=$$FMTE^BQIUL1($P(^DIC(19.2,OPN,0),U,2))
Q
;
NXRUN(DAY) ;EP
NEW CIPC
S CIPC=$P($G(^BQI(90508,1,8)),U,10)
S BQMON=$E(CIPC,4,5),CYR=$E(CIPC,1,3)
;S BQMON=$E(DT,4,5),CYR=$E(DT,1,3)
I BQMON=12 S BQMON=1,CYR=CYR+1
E S BQMON=BQMON+1
I $L(BQMON)=1 S BQMON="0"_BQMON
S BEGDT=CYR_BQMON_DAY
S BQSCHED=$$FMTE^BQIUL1(BEGDT)_" "_$P($$FMTE^XLFDT(BQNSCH),"@",2)
Q
;
TSK(ZTSK) ;EP
I $G(ZTSK)="" Q ""
D STAT^%ZTLOAD
Q $G(ZTSK(2))
;
QTSK(ZTSK) ;EP
NEW STRT
S STRT=$P($G(^%ZTSK(ZTSK,0)),U,6),STRT=$$HTFM^XLFDT(STRT)
S BQSCHED=$$FMTE^BQIUL1(STRT)
Q
BQISYSIT ;APTIV/HC/ALA-System Site Parameters for iCare ; 11 Apr 2008 3:43 PM
+1 ;;2.7;ICARE MANAGEMENT SYSTEM;**1**;Dec 19, 2017;Build 12
+2 ;
GET(DATA,FAKE) ;EP -- BQI GET SYSTEM PARAMETERS
+1 ; Get specific iCare system parameters from the Site Parameter file
+2 NEW UID,II,NUM,IEN
+3 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+4 SET DATA=$NAME(^TMP("BQISYSIT",UID))
+5 KILL @DATA
+6 ;
+7 SET II=0
+8 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER"
+9 ;
+10 SET @DATA@(II)="I00010NUM_CONN"_$CHAR(30)
+11 ;
+12 SET IEN=$$SPM^BQIGPUTL()
+13 SET NUM=$$GET1^DIQ(90508,IEN_",",.19,"E")
IF NUM=""
SET NUM=3
+14 SET II=II+1
SET @DATA@(II)=NUM_$CHAR(30)
+15 ;
+16 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+17 QUIT
+18 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT
+7 ;
JOB(DATA,FAKE) ; EP - BQI GET SYSTEM JOB DATA
+1 NEW UID,II,NUM,IEN,OPTN,JOB,FLDS,BQSCHED,BQI,SDATA,TYPE,START,FROM,THRU
+2 NEW END,STAT,OPN,TYP,TASK,TSK,BQNSCH
+3 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+4 SET DATA=$NAME(^TMP("BQISYSIT",UID))
+5 KILL @DATA
+6 ;
+7 SET II=0
+8 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER"
+9 ;
+10 SET @DATA@(II)="T00015JOB^T00015TYPE^D00030START^D00030END^T00015STATUS^T00050NEXT_DUE"_$CHAR(30)
+11 ;
+12 SET IEN=$$SPM^BQIGPUTL()
SET BQSCHED=""
+13 SET OPTN=$$FIND^BQISCHED("BQI NIGHTLY BACKGROUND")
+14 IF $ORDER(^DIC(19.2,"B",OPTN,""))=""
SET BQSCHED="Not scheduled"
+15 SET JOB="NIGHTLY"
+16 SET FLDS="Flags;3.01;3.02;3.03^Natl Measures;3.07;3.08;3.09^Diagnostic Tags;3.04;3.05;3.06^Reminders;3.1;3.11;3.12^Best Practice Prompts;3.13;3.14;"
+17 SET FLDS=FLDS_"3.15^Comm Alerts;3.16;3.17;3.18^Panel Autopopulate;3.19;3.2;3.21^Care Mgmt Update;3.22;3.23;3.24"
DO RET
+18 ; CMET
+19 SET START=$$FMTE^BQIUL1($PIECE(^BTPW(90628,IEN,0),U,6))
+20 SET END=$$FMTE^BQIUL1($PIECE(^BTPW(90628,IEN,0),U,7))
+21 SET STAT=$$GET1^DIQ(90628,IEN_",",.08,"E")
+22 SET TASK=24.11
SET TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E")
IF TSK'=""
SET STAT=$$TSK(TSK)
+23 SET II=II+1
SET @DATA@(II)=JOB_U_"CMET Data Mining"_U_START_U_END_U_STAT_U_BQSCHED_$CHAR(30)
+24 ;
+25 SET OPTN=$$FIND^BQISCHED("BQI UPDATE TASK")
+26 IF $ORDER(^DIC(19.2,"B",OPTN,""))=""
SET BQSCHED="Not scheduled"
+27 SET JOB="WEEKLY"
SET FLDS="Diagnostic Tags;4.01;4.02;4.03;24.04^Natl Measures;4.04;4.05;4.06;24.05^Reminders;4.07;4.08;4.09;24.06^Best Practice Prompts;4.1;4.11;4.12;24.02"
DO RET
+28 SET JOB="WEEKLY"
SET FLDS="Care Mgmt Update;4.13;4.14;4.15;24.03^IPC;8.04;8.05;8.06;11.06"
DO RET
+29 ;
+30 SET JOB="MONTHLY"
SET FLDS="IPC Update;8.1;8.11;8.12;24.08"
DO RET
+31 ;
+32 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+33 QUIT
+34 ;
RET ; Retrieve data
+1 FOR BQI=1:1:$LENGTH(FLDS,"^")
Begin DoDot:1
+2 SET SDATA=$PIECE(FLDS,"^",BQI)
+3 SET TYP=$PIECE(SDATA,";",1)
SET FROM=$PIECE(SDATA,";",2)
SET THRU=$PIECE(SDATA,";",3)
SET STAT=$PIECE(SDATA,";",4)
SET TASK=$PIECE(SDATA,";",5)
+4 SET START=$$FMTE^BQIUL1($$GET1^DIQ(90508,IEN_",",FROM,"I"))
+5 SET END=$$FMTE^BQIUL1($$GET1^DIQ(90508,IEN_",",THRU,"I"))
+6 SET STAT=$$GET1^DIQ(90508,IEN_",",STAT,"E")
SET BQSCHED=""
+7 SET TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E")
IF TSK'=""
SET STAT=$$TSK(TSK)
+8 IF JOB="NIGHTLY"
Begin DoDot:2
+9 IF STAT'=""
SET TASK=24.01
SET TSK=$$GET1^DIQ(90508,IEN_",",TASK,"E")
IF TSK'=""
SET STAT=$$TSK(TSK)
+10 SET OPTN=$$FIND^BQISCHED("BQI NIGHTLY BACKGROUND")
+11 IF OPTN'>0
SET BQSCHED="Not scheduled"
QUIT
+12 SET OPN=$ORDER(^DIC(19.2,"B",OPTN,""))
+13 IF OPN=""
SET BQSCHED="Not scheduled"
QUIT
+14 SET BQSCHED=$$FMTE^BQIUL1($PIECE(^DIC(19.2,OPN,0),U,2))
SET BQNSCH=$PIECE(^DIC(19.2,OPN,0),U,2)
End DoDot:2
+15 IF JOB="WEEKLY"
Begin DoDot:2
+16 IF TYP="Diagnostic Tags"!(TYP="Natl Measures")
Begin DoDot:3
+17 SET OPTN=$$FIND^BQISCHED("BQI UPDATE TASK")
+18 IF OPTN'>0
SET BQSCHED="Not scheduled"
QUIT
+19 SET OPN=$ORDER(^DIC(19.2,"B",OPTN,""))
+20 IF OPN=""
SET BQSCHED="Not scheduled"
QUIT
+21 SET BQSCHED=$$FMTE^BQIUL1($PIECE(^DIC(19.2,OPN,0),U,2))
End DoDot:3
+22 IF TYP="Reminders"
DO OPRET("BQI UPDATE ALL REMINDERS")
+23 IF TYP="Best Practice Prompts"
DO OPRET("BQI UPDATE TREATMENT")
+24 IF TYP="Care Mgmt Update"
DO OPRET("BQI UPDATE CARE MGMT")
+25 IF TYP="IPC"
Begin DoDot:3
+26 NEW CDOW,DFL,WDATE
+27 SET CDOW=$$DOW^XLFDT(DT,1)
IF CDOW'=0
Begin DoDot:4
End DoDot:4
+28 SET DFL=0
+29 FOR I=1:1
IF DFL
QUIT
Begin DoDot:4
+30 SET WDATE=$$FMADD^XLFDT(DT,+I)
SET CDOW=$$DOW^XLFDT(WDATE,1)
+31 IF CDOW=0
SET DFL=1
SET BQSCHED=WDATE_"."_$PIECE($PIECE($GET(^BQI(90508,1,4)),"^",19),".",2)
SET BQSCHED=$$FMTE^BQIUL1(BQSCHED)
End DoDot:4
IF DFL
QUIT
End DoDot:3
End DoDot:2
+32 ;
+33 IF JOB="MONTHLY"
Begin DoDot:2
+34 IF TYP="MU Clinical Quality"
Begin DoDot:3
+35 NEW ZTSK
+36 SET ZTSK=$PIECE(^BQI(90508,1,12),U,5)
IF ZTSK'=""
DO QTSK(ZTSK)
QUIT
+37 IF ZTSK=""
DO NXRUN("01")
QUIT
End DoDot:3
+38 IF TYP="MU Performance"
Begin DoDot:3
+39 NEW ZTSK
+40 SET ZTSK=$PIECE(^BQI(90508,1,12),U,6)
IF ZTSK'=""
DO QTSK(ZTSK)
QUIT
+41 IF ZTSK=""
DO NXRUN("01")
End DoDot:3
+42 IF TYP="IPC Update"
Begin DoDot:3
+43 NEW DY
+44 SET DY=$PIECE(^BQI(90508,1,11),U,2)
+45 DO NXRUN("0"_DY)
QUIT
End DoDot:3
End DoDot:2
+46 SET II=II+1
SET @DATA@(II)=JOB_U_TYP_U_START_U_END_U_STAT_U_BQSCHED_$CHAR(30)
End DoDot:1
+47 QUIT
+48 ;
PTCH(DATA,PATCH) ;EP - BQI CHECK PATCH STATUS
+1 ; Input parameter
+2 ; PATCH - Standard KIDS patch format e.g. BQI*1.1*2 or BGP*8.0*2
+3 NEW UID,II,RESULT,MSG
+4 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+5 SET DATA=$NAME(^TMP("BQISYPTCH",UID))
+6 KILL @DATA
+7 ;
+8 SET II=0
+9 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER"
+10 ;
+11 SET @DATA@(II)="I00010RESULT^T00100MSG"_$CHAR(30)
+12 SET RESULT=$$PATCH^XPDUTL(PATCH)
+13 IF RESULT=0
SET RESULT=-1
SET MSG="Patch is not installed"
+14 SET II=II+1
SET @DATA@(II)=RESULT_"^"_$GET(MSG)_$CHAR(30)
+15 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+16 QUIT
+17 ;
VRCH(DATA,PKG) ; EP - BQI CHECK VERSION STATUS
+1 ; Input parameter
+2 ; PKG - Standard Package namespace e.g. BQI or BGP.
+3 NEW UID,II,RESULT
+4 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+5 SET DATA=$NAME(^TMP("BQISYVRCH",UID))
+6 KILL @DATA
+7 ;
+8 SET II=0
+9 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER"
+10 ;
+11 SET @DATA@(II)="T00010VERSION"_$CHAR(30)
+12 SET RESULT=$$VERSION^XPDUTL(PKG)
+13 SET II=II+1
SET @DATA@(II)=RESULT_$CHAR(30)
+14 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+15 QUIT
+16 ;
JTIP(DATA,FAKE) ;EP - BQI GET JOB TOOLTIPS
+1 NEW UID,II,BQIDA,TDTA,PC,ND,TEXT,NN,TXT
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("BQISYSTP",UID))
+4 KILL @DATA
+5 ;
+6 SET II=0
+7 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQISYSIT D UNWIND^%ZTER"
+8 ;
+9 SET @DATA@(II)="T01024JOB^T01024TYPE^T01024END^T01024START^T01024STATUS^T01024NEXT_DUE"_$CHAR(30)
+10 ;
+11 SET BQIDA=$$SPM^BQIGPUTL()
SET II=II+1
+12 ; Process the word-processing tooltips
+13 FOR TDTA="5,1","6,2","7,3"
DO JTXT
+14 ;
+15 FOR PC=1:1:3
SET $PIECE(@DATA@(II),U,(PC+3))=$PIECE(^BQI(90508,BQIDA,8),U,PC)
+16 SET @DATA@(II)=@DATA@(II)_$CHAR(30)
+17 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+18 QUIT
+19 ;
JTXT ;
+1 SET ND=$PIECE(TDTA,",",1)
SET PC=$PIECE(TDTA,",",2)
+2 SET TEXT=""
SET NN=0
+3 FOR
SET NN=$ORDER(^BQI(90508,BQIDA,ND,NN))
IF 'NN
QUIT
Begin DoDot:1
+4 SET TXT=^BQI(90508,BQIDA,ND,NN,0)
+5 SET TEXT=TEXT_TXT_$CHAR(10)
End DoDot:1
+6 SET $PIECE(@DATA@(II),U,PC)=$$TKO^BQIUL1(TEXT,$CHAR(10))
+7 QUIT
+8 ;
OPRET(RPC) ;EP
+1 SET OPTN=$$FIND^BQISCHED(RPC)
+2 IF OPTN'>0
SET BQSCHED="Not scheduled"
QUIT
+3 SET OPN=$ORDER(^DIC(19.2,"B",OPTN,""))
+4 IF OPN=""
SET BQSCHED="Not scheduled"
QUIT
+5 SET BQSCHED=$$FMTE^BQIUL1($PIECE(^DIC(19.2,OPN,0),U,2))
+6 QUIT
+7 ;
NXRUN(DAY) ;EP
+1 NEW CIPC
+2 SET CIPC=$PIECE($GET(^BQI(90508,1,8)),U,10)
+3 SET BQMON=$EXTRACT(CIPC,4,5)
SET CYR=$EXTRACT(CIPC,1,3)
+4 ;S BQMON=$E(DT,4,5),CYR=$E(DT,1,3)
+5 IF BQMON=12
SET BQMON=1
SET CYR=CYR+1
+6 IF '$TEST
SET BQMON=BQMON+1
+7 IF $LENGTH(BQMON)=1
SET BQMON="0"_BQMON
+8 SET BEGDT=CYR_BQMON_DAY
+9 SET BQSCHED=$$FMTE^BQIUL1(BEGDT)_" "_$PIECE($$FMTE^XLFDT(BQNSCH),"@",2)
+10 QUIT
+11 ;
TSK(ZTSK) ;EP
+1 IF $GET(ZTSK)=""
QUIT ""
+2 DO STAT^%ZTLOAD
+3 QUIT $GET(ZTSK(2))
+4 ;
QTSK(ZTSK) ;EP
+1 NEW STRT
+2 SET STRT=$PIECE($GET(^%ZTSK(ZTSK,0)),U,6)
SET STRT=$$HTFM^XLFDT(STRT)
+3 SET BQSCHED=$$FMTE^BQIUL1(STRT)
+4 QUIT