BQIPLMRU ;PRXM/HC/ALA - Most Recently Viewed Panels ; 17 Feb 2006 12:20 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
RET(DATA) ; EP - BQI GET MRU PANELS
;Get the list of most recently viewed panels
;Output
; DATA - name of global (passed by reference) in which the data
; is stored
;Assumes
; DUZ - User who signed onto iCare
;
NEW UID,II,BQIN,BQITXT,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLMRU",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLMRU D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00250PANEL_ID_LIST"_$C(30)
S BQIN=0,BQITXT=""
F S BQIN=$O(^BQICARE(DUZ,5,BQIN)) Q:'BQIN D
. NEW DA,IENS
. S DA(1)=DUZ,DA=BQIN,IENS=$$IENS^DILF(.DA)
. S BQITXT=BQITXT_$$GET1^DIQ(90505.5,IENS,.01,"E")_$C(29)
S BQITXT=$$TKO^BQIUL1(BQITXT,$C(29))
S II=II+1,@DATA@(II)=BQITXT_$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
;
UPD(DATA,PLIST) ; EP - BQI SET MRU PANELS
;Update the list of most recently viewed panels
;
;Input
; PLIST - List of panel ids separated by $C(29)
;Assumes
; DUZ - User who signed onto iCare
;
NEW UID,II,X,RESULT,BQI
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLMRU",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLMRU D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
S @DATA@(II)="I00010RESULT"_$C(30)
;
S PLIST=$G(PLIST,"")
NEW DIK,DA
D DEL
;
I $G(PLIST)="" D Q
. S II=II+1,@DATA@(II)="1"_$C(30)
. S II=II+1,@DATA@(II)=$C(31)
;
I '$D(^BQICARE(DA(1),5,0)) S ^BQICARE(DA(1),5,0)="^90505.5^^"
S RESULT=0
F BQI=1:1:$L(PLIST,$C(29)) D
. NEW DA,IENS,BQIVL,DIC
. S BQIVL=$P(PLIST,$C(29),BQI)
. S DA(1)=DUZ,X=BQIVL,DIC(0)="L",DIC="^BQICARE("_DA(1)_",5,"
. D ^DIC
. I +Y>0 S RESULT=1
;
S II=II+1,@DATA@(II)=RESULT_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
;
DEL ; Remove old panel id list first
S DA(1)=DUZ,DA=0,DIK="^BQICARE("_DA(1)_",5,"
F S DA=$O(^BQICARE(DA(1),5,DA)) Q:'DA D ^DIK
Q
BQIPLMRU ;PRXM/HC/ALA - Most Recently Viewed Panels ; 17 Feb 2006 12:20 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
RET(DATA) ; EP - BQI GET MRU PANELS
+1 ;Get the list of most recently viewed panels
+2 ;Output
+3 ; DATA - name of global (passed by reference) in which the data
+4 ; is stored
+5 ;Assumes
+6 ; DUZ - User who signed onto iCare
+7 ;
+8 NEW UID,II,BQIN,BQITXT,X
+9 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+10 SET DATA=$NAME(^TMP("BQIPLMRU",UID))
+11 KILL @DATA
+12 ;
+13 SET II=0
+14 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLMRU D UNWIND^%ZTER"
+15 ;
+16 SET @DATA@(II)="T00250PANEL_ID_LIST"_$CHAR(30)
+17 SET BQIN=0
SET BQITXT=""
+18 FOR
SET BQIN=$ORDER(^BQICARE(DUZ,5,BQIN))
IF 'BQIN
QUIT
Begin DoDot:1
+19 NEW DA,IENS
+20 SET DA(1)=DUZ
SET DA=BQIN
SET IENS=$$IENS^DILF(.DA)
+21 SET BQITXT=BQITXT_$$GET1^DIQ(90505.5,IENS,.01,"E")_$CHAR(29)
End DoDot:1
+22 SET BQITXT=$$TKO^BQIUL1(BQITXT,$CHAR(29))
+23 SET II=II+1
SET @DATA@(II)=BQITXT_$CHAR(30)
+24 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+25 QUIT
+26 ;
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 ;
UPD(DATA,PLIST) ; EP - BQI SET MRU PANELS
+1 ;Update the list of most recently viewed panels
+2 ;
+3 ;Input
+4 ; PLIST - List of panel ids separated by $C(29)
+5 ;Assumes
+6 ; DUZ - User who signed onto iCare
+7 ;
+8 NEW UID,II,X,RESULT,BQI
+9 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+10 SET DATA=$NAME(^TMP("BQIPLMRU",UID))
+11 KILL @DATA
+12 ;
+13 SET II=0
+14 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLMRU D UNWIND^%ZTER"
+15 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+16 ;
+17 SET PLIST=$GET(PLIST,"")
+18 NEW DIK,DA
+19 DO DEL
+20 ;
+21 IF $GET(PLIST)=""
Begin DoDot:1
+22 SET II=II+1
SET @DATA@(II)="1"_$CHAR(30)
+23 SET II=II+1
SET @DATA@(II)=$CHAR(31)
End DoDot:1
QUIT
+24 ;
+25 IF '$DATA(^BQICARE(DA(1),5,0))
SET ^BQICARE(DA(1),5,0)="^90505.5^^"
+26 SET RESULT=0
+27 FOR BQI=1:1:$LENGTH(PLIST,$CHAR(29))
Begin DoDot:1
+28 NEW DA,IENS,BQIVL,DIC
+29 SET BQIVL=$PIECE(PLIST,$CHAR(29),BQI)
+30 SET DA(1)=DUZ
SET X=BQIVL
SET DIC(0)="L"
SET DIC="^BQICARE("_DA(1)_",5,"
+31 DO ^DIC
+32 IF +Y>0
SET RESULT=1
End DoDot:1
+33 ;
+34 SET II=II+1
SET @DATA@(II)=RESULT_$CHAR(30)
+35 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+36 QUIT
+37 ;
DEL ; Remove old panel id list first
+1 SET DA(1)=DUZ
SET DA=0
SET DIK="^BQICARE("_DA(1)_",5,"
+2 FOR
SET DA=$ORDER(^BQICARE(DA(1),5,DA))
IF 'DA
QUIT
DO ^DIK
+3 QUIT