BQIPLLOG ;PRXM/HC/ALA-Login Date/Time ; 04 May 2006 2:37 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA,FAKE) ; EP -- BQI GET LAST LOGIN
;Description
; Get date/time of last login
;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,LOGDTM,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLLOG",UID))
K @DATA
;
S II=0
S @DATA@(II)="D00030LAST_LOG_DATETIME"_$C(30)
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLOG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S LOGDTM=$$GET1^DIQ(90505,DUZ_",",.06,"I")
S II=II+1,@DATA@(II)=$$FMTE^BQIUL1(LOGDTM)_$C(30)
;
DONE ;
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,VALUE) ; EP -- BQI SET LAST LOGIN
;
; Input
; VALUE - the value
;Output
; DATA - name of global (passed by reference) in which the data
; is stored
;Assumes DUZ the user signed onto iCare
NEW UID,II,ERROR,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLLOG",UID))
K @DATA
S II=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLOG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010RESULT"_$C(30)
S VALUE=$G(VALUE,"")
I VALUE="" S VALUE=$$NOW^XLFDT()
;
S BQIUPD(90505,DUZ_",",.06)=VALUE
D FILE^DIE("","BQIUPD","ERROR")
K BQIUPD
S II=II+1
I '$D(ERROR) S @DATA@(II)="1"_$C(30)
I $D(ERROR) S @DATA@(II)="-1"_$C(30)
S II=II+1,@DATA@(II)=$C(31)
;
CHK ; Check for the first log in of the day
NEW DA,LOGDTM,CDTM,CFLG
S DA=$O(^BQI(90508,0)) Q:DA=""
S LOGDTM=$$GET1^DIQ(90508,DA_",",9,"I")
S CDTM=$$NOW^XLFDT(),CFLG=0
I LOGDTM="" S BQIUPD(90508,DA_",",9)=CDTM,CFLG=1
I LOGDTM'="" D
. I $P(CDTM,".",1)=$P(LOGDTM,".",1) Q
. S BQIUPD(90508,DA_",",9)=CDTM,CFLG=1
D FILE^DIE("","BQIUPD","ERROR")
;
; Check tasks
I CFLG D ^BQISCHED
Q
BQIPLLOG ;PRXM/HC/ALA-Login Date/Time ; 04 May 2006 2:37 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA,FAKE) ; EP -- BQI GET LAST LOGIN
+1 ;Description
+2 ; Get date/time of last login
+3 ;Input
+4 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+5 ;Output
+6 ; DATA - name of global (passed by reference) in which the data
+7 ; is stored
+8 ;Expects
+9 ; DUZ - the internal entry number of the person signed on
+10 ;
+11 NEW UID,II,LOGDTM,X
+12 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+13 SET DATA=$NAME(^TMP("BQIPLLOG",UID))
+14 KILL @DATA
+15 ;
+16 SET II=0
+17 SET @DATA@(II)="D00030LAST_LOG_DATETIME"_$CHAR(30)
+18 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLLOG D UNWIND^%ZTER"
+19 ;
+20 SET LOGDTM=$$GET1^DIQ(90505,DUZ_",",.06,"I")
+21 SET II=II+1
SET @DATA@(II)=$$FMTE^BQIUL1(LOGDTM)_$CHAR(30)
+22 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
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,VALUE) ; EP -- BQI SET LAST LOGIN
+1 ;
+2 ; Input
+3 ; VALUE - the value
+4 ;Output
+5 ; DATA - name of global (passed by reference) in which the data
+6 ; is stored
+7 ;Assumes DUZ the user signed onto iCare
+8 NEW UID,II,ERROR,X
+9 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+10 SET DATA=$NAME(^TMP("BQIPLLOG",UID))
+11 KILL @DATA
+12 SET II=0
+13 ;
+14 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLLOG D UNWIND^%ZTER"
+15 ;
+16 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+17 SET VALUE=$GET(VALUE,"")
+18 IF VALUE=""
SET VALUE=$$NOW^XLFDT()
+19 ;
+20 SET BQIUPD(90505,DUZ_",",.06)=VALUE
+21 DO FILE^DIE("","BQIUPD","ERROR")
+22 KILL BQIUPD
+23 SET II=II+1
+24 IF '$DATA(ERROR)
SET @DATA@(II)="1"_$CHAR(30)
+25 IF $DATA(ERROR)
SET @DATA@(II)="-1"_$CHAR(30)
+26 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+27 ;
CHK ; Check for the first log in of the day
+1 NEW DA,LOGDTM,CDTM,CFLG
+2 SET DA=$ORDER(^BQI(90508,0))
IF DA=""
QUIT
+3 SET LOGDTM=$$GET1^DIQ(90508,DA_",",9,"I")
+4 SET CDTM=$$NOW^XLFDT()
SET CFLG=0
+5 IF LOGDTM=""
SET BQIUPD(90508,DA_",",9)=CDTM
SET CFLG=1
+6 IF LOGDTM'=""
Begin DoDot:1
+7 IF $PIECE(CDTM,".",1)=$PIECE(LOGDTM,".",1)
QUIT
+8 SET BQIUPD(90508,DA_",",9)=CDTM
SET CFLG=1
End DoDot:1
+9 DO FILE^DIE("","BQIUPD","ERROR")
+10 ;
+11 ; Check tasks
+12 IF CFLG
DO ^BQISCHED
+13 QUIT