BQIUSPRF ;GDHD/HS/ALA-User GUI Preferences ; 26 Sep 2007 1:53 PM
;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
;
Q
;
GTAB(DATA,FAKE) ;EP - BQI GET USER GUI TABS
;
;Description
; Get the user's preferences
;Input
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
;Output
; DATA - name of global (passed by reference) in which the data
; is stored
;Expects
; DUZ - the internal entry number of the person signed on
NEW UID,II,IEN,TEXT,BN,TYP
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIGTAB",UID))
K @DATA
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIUSPRF D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
S @DATA@(II)="I00010IEN^T00001STATUS^T00010TYPE"_$C(30)
I $O(^BQICARE(DUZ,13,0))="" D DEF G DONE
S BN=0
F S BN=$O(^BQICARE(DUZ,13,BN)) Q:'BN D
. S IEN=$P(^BQICARE(DUZ,13,BN,0),U,1)
. ;S TEXT=$P(^BQI(90506.4,IEN,0),U,1),STAT=$P(^(0),U,2)
. S STAT=$P(^BQICARE(DUZ,13,BN,0),U,2)
. S TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
. S II=II+1,@DATA@(II)=IEN_U_STAT_U_TYP_$C(30)
;
;Check for new tabs
S IEN=0 F S IEN=$O(^BQI(90506.4,IEN)) Q:'IEN D
. I '$D(^BQICARE(DUZ,13,"B",IEN)) D
.. S TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
.. S II=II+1,@DATA@(II)=IEN_U_"S"_U_TYP_$C(30)
;
DONE ;
S II=II+1,@DATA@(II)=$C(31)
Q
;
DEF ;
S IEN=0
F S IEN=$O(^BQI(90506.4,IEN)) Q:'IEN D
. S TEXT=$P(^BQI(90506.4,IEN,0),U,1),DEF=""
. ;I TEXT="Cover Sheet"!(TEXT="Patient List") S DEF="D"
. S TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
. S II=II+1,@DATA@(II)=IEN_U_"S"_U_TYP_$C(30)
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
;
UTAB(DATA,TYP,TABS) ;EP - BQI SET USER GUI TABS
; Input
; Assumes DUZ
; TABS - list of tab IENs separated by $C(29)
NEW UID,II,ERROR
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIUTAB",UID))
K @DATA
S II=0
S @DATA@(II)="I00010RESULT"_$C(30)
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIUSPRF D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S ^ALTST($$NOW^XLFDT())=$G(TABS)
; Clean up previous list of GUI tabs
NEW DA,DIK,TBS
S DA(1)=DUZ,DIK="^BQICARE("_DA(1)_",13,",DA=""
F S DA=$O(^BQICARE(DUZ,13,"AC",TYP,DA)) Q:'DA D ^DIK
;
F BI=1:1:$L(TABS,$C(29)) S TBS=$P(TABS,$C(29),BI) Q:TBS="" D
. NEW DA,X,DINUM,DIC,DIE,DLAYGO,IENS
. ;Get IEN and Status
. S TIEN=$P(TBS,$C(28),1),STAT=$P(TBS,$C(28),2)
. S DA(1)=DUZ
. S DIC="^BQICARE("_DA(1)_",13,",DIE=DIC
. S DLAYGO=90505.013,DIC(0)="L",DIC("P")=DLAYGO
. S X=TIEN
. I '$D(^BQICARE(DA(1),13,0)) S ^BQICARE(DA(1),13,0)="^90505.013P^^"
. ;K DO,DD D ^DIC
. D ^DIC i Y=-1 K DO,DD D FILE^DICN
. I +Y<1 S RESULT=-1 Q
. S DA=+Y,IENS=$$IENS^DILF(.DA)
. S BQIUPD(90505.013,IENS,.02)=STAT,BQIUPD(90505.013,IENS,.03)=TYP
. S RESULT=1
;
I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR") I $D(ERROR) S RESULT=-1
;
S II=II+1,@DATA@(II)=RESULT_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
BQIUSPRF ;GDHD/HS/ALA-User GUI Preferences ; 26 Sep 2007 1:53 PM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
+2 ;
+3 QUIT
+4 ;
GTAB(DATA,FAKE) ;EP - BQI GET USER GUI TABS
+1 ;
+2 ;Description
+3 ; Get the user's preferences
+4 ;Input
+5 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+6 ;Output
+7 ; DATA - name of global (passed by reference) in which the data
+8 ; is stored
+9 ;Expects
+10 ; DUZ - the internal entry number of the person signed on
+11 NEW UID,II,IEN,TEXT,BN,TYP
+12 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+13 SET DATA=$NAME(^TMP("BQIGTAB",UID))
+14 KILL @DATA
+15 SET II=0
+16 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIUSPRF D UNWIND^%ZTER"
+17 SET @DATA@(II)="I00010IEN^T00001STATUS^T00010TYPE"_$CHAR(30)
+18 IF $ORDER(^BQICARE(DUZ,13,0))=""
DO DEF
GOTO DONE
+19 SET BN=0
+20 FOR
SET BN=$ORDER(^BQICARE(DUZ,13,BN))
IF 'BN
QUIT
Begin DoDot:1
+21 SET IEN=$PIECE(^BQICARE(DUZ,13,BN,0),U,1)
+22 ;S TEXT=$P(^BQI(90506.4,IEN,0),U,1),STAT=$P(^(0),U,2)
+23 SET STAT=$PIECE(^BQICARE(DUZ,13,BN,0),U,2)
+24 SET TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
+25 SET II=II+1
SET @DATA@(II)=IEN_U_STAT_U_TYP_$CHAR(30)
End DoDot:1
+26 ;
+27 ;Check for new tabs
+28 SET IEN=0
FOR
SET IEN=$ORDER(^BQI(90506.4,IEN))
IF 'IEN
QUIT
Begin DoDot:1
+29 IF '$DATA(^BQICARE(DUZ,13,"B",IEN))
Begin DoDot:2
+30 SET TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
+31 SET II=II+1
SET @DATA@(II)=IEN_U_"S"_U_TYP_$CHAR(30)
End DoDot:2
End DoDot:1
+32 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
DEF ;
+1 SET IEN=0
+2 FOR
SET IEN=$ORDER(^BQI(90506.4,IEN))
IF 'IEN
QUIT
Begin DoDot:1
+3 SET TEXT=$PIECE(^BQI(90506.4,IEN,0),U,1)
SET DEF=""
+4 ;I TEXT="Cover Sheet"!(TEXT="Patient List") S DEF="D"
+5 SET TYP=$$GET1^DIQ(90506.4,IEN_",",.03,"E")
+6 SET II=II+1
SET @DATA@(II)=IEN_U_"S"_U_TYP_$CHAR(30)
End DoDot:1
+7 QUIT
+8 ;
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 ;
UTAB(DATA,TYP,TABS) ;EP - BQI SET USER GUI TABS
+1 ; Input
+2 ; Assumes DUZ
+3 ; TABS - list of tab IENs separated by $C(29)
+4 NEW UID,II,ERROR
+5 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+6 SET DATA=$NAME(^TMP("BQIUTAB",UID))
+7 KILL @DATA
+8 SET II=0
+9 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+10 ;
+11 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIUSPRF D UNWIND^%ZTER"
+12 ;
+13 SET ^ALTST($$NOW^XLFDT())=$GET(TABS)
+14 ; Clean up previous list of GUI tabs
+15 NEW DA,DIK,TBS
+16 SET DA(1)=DUZ
SET DIK="^BQICARE("_DA(1)_",13,"
SET DA=""
+17 FOR
SET DA=$ORDER(^BQICARE(DUZ,13,"AC",TYP,DA))
IF 'DA
QUIT
DO ^DIK
+18 ;
+19 FOR BI=1:1:$LENGTH(TABS,$CHAR(29))
SET TBS=$PIECE(TABS,$CHAR(29),BI)
IF TBS=""
QUIT
Begin DoDot:1
+20 NEW DA,X,DINUM,DIC,DIE,DLAYGO,IENS
+21 ;Get IEN and Status
+22 SET TIEN=$PIECE(TBS,$CHAR(28),1)
SET STAT=$PIECE(TBS,$CHAR(28),2)
+23 SET DA(1)=DUZ
+24 SET DIC="^BQICARE("_DA(1)_",13,"
SET DIE=DIC
+25 SET DLAYGO=90505.013
SET DIC(0)="L"
SET DIC("P")=DLAYGO
+26 SET X=TIEN
+27 IF '$DATA(^BQICARE(DA(1),13,0))
SET ^BQICARE(DA(1),13,0)="^90505.013P^^"
+28 ;K DO,DD D ^DIC
+29 DO ^DIC
IF Y=-1
KILL DO,DD
DO FILE^DICN
+30 IF +Y<1
SET RESULT=-1
QUIT
+31 SET DA=+Y
SET IENS=$$IENS^DILF(.DA)
+32 SET BQIUPD(90505.013,IENS,.02)=STAT
SET BQIUPD(90505.013,IENS,.03)=TYP
+33 SET RESULT=1
End DoDot:1
+34 ;
+35 IF $DATA(BQIUPD)
DO FILE^DIE("","BQIUPD","ERROR")
IF $DATA(ERROR)
SET RESULT=-1
+36 ;
+37 SET II=II+1
SET @DATA@(II)=RESULT_$CHAR(30)
+38 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+39 QUIT