BQIPLUS1 ;GDIT/HS/ALA-User Preferences continued ; 26 Apr 2013 11:11 AM
;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
;
UGVMCH(DATA,FAKE) ;EP -- BQI GET USER VERSION
;
;Description
; Determine if user iCare version does not match iCare server version
;
;Input
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
;Output
; Returns user GUI version, server version, and whether versions match (1-Match/0-Do Not Match)
;
;Expects
; DUZ - the internal entry number of the person signed on
;
NEW UID,II,BQIDA,MVRSN,UVRSN,SVRSN
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLUSR",UID))
K @DATA
;
I '$$OWNR(DUZ) S BMXSEC="There is a problem with your entry." Q
;
S II=0
S @DATA@(II)="T00001MATCHING_VERSION^T00020USER_VERSION^T00020SERVER_VERSION"_$C(30)
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLUSR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S BQIDA=$$SPM^BQIGPUTL()
;
S UVRSN=$$GET1^DIQ(90505,DUZ_",",.17,"E")
S SVRSN=$$GET1^DIQ(90508,BQIDA_",",.08,"E")
S MVRSN=0 I UVRSN=SVRSN S MVRSN=1
;
S II=II+1,@DATA@(II)=MVRSN_U_UVRSN_U_SVRSN_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
;
USVMCH(DATA,FAKE) ;EP -- BQI SET USER VERSION
;
;Description
; Set the user's iCare GUI version to match the iCare server GUI version
;
;Input
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
;Output
; Returns 1-Successful save/-1 - Unsuccessful save
;
;Expects
; DUZ - the internal entry number of the person signed on
;
NEW UID,II,BQIDA,SVRSN,BQIUPD,ERROR
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLUSR",UID))
K @DATA
;
I '$$OWNR(DUZ) S BMXSEC="There is a problem with your entry." Q
;
S II=0
S @DATA@(II)="I00010RESULT"_$C(30)
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLUSR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S BQIDA=$$SPM^BQIGPUTL()
S SVRSN=$$GET1^DIQ(90508,BQIDA_",",.08,"E")
;
S BQIUPD(90505,DUZ_",",.17)=SVRSN
;
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)
Q
;
OWNR(USR) ;EP -- Check owner
;
;Description
; Check if this user who has signed into iCare is already
; in ICARE USER File #90505
;Input
; DUZ - User internal entry number signed into iCare
;Output
; 1 - if user exists or if user added okay
; 0 - if there was an error adding user
;
I $G(^BQICARE(USR,0))'="" Q 1
I $D(^BQICARE(USR)),$G(^BQICARE(USR,0))="" D Q 1
. NEW DIE,DA,DR
. S DIE="^BQICARE(",DA=USR,DR=".01///^S X=USR" D ^DIE
;
CR ; Create new entry
NEW IENARRY,BQIUSR,ERROR
S IENARRY(1)=USR
S BQIUSR(90505,"+1,",.01)=USR
D UPDATE^DIE("","BQIUSR","IENARRY","ERROR")
I $D(ERROR) Q 0
Q 1
BQIPLUS1 ;GDIT/HS/ALA-User Preferences continued ; 26 Apr 2013 11:11 AM
+1 ;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
+2 ;
UGVMCH(DATA,FAKE) ;EP -- BQI GET USER VERSION
+1 ;
+2 ;Description
+3 ; Determine if user iCare version does not match iCare server version
+4 ;
+5 ;Input
+6 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+7 ;Output
+8 ; Returns user GUI version, server version, and whether versions match (1-Match/0-Do Not Match)
+9 ;
+10 ;Expects
+11 ; DUZ - the internal entry number of the person signed on
+12 ;
+13 NEW UID,II,BQIDA,MVRSN,UVRSN,SVRSN
+14 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+15 SET DATA=$NAME(^TMP("BQIPLUSR",UID))
+16 KILL @DATA
+17 ;
+18 IF '$$OWNR(DUZ)
SET BMXSEC="There is a problem with your entry."
QUIT
+19 ;
+20 SET II=0
+21 SET @DATA@(II)="T00001MATCHING_VERSION^T00020USER_VERSION^T00020SERVER_VERSION"_$CHAR(30)
+22 ;
+23 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLUSR D UNWIND^%ZTER"
+24 ;
+25 SET BQIDA=$$SPM^BQIGPUTL()
+26 ;
+27 SET UVRSN=$$GET1^DIQ(90505,DUZ_",",.17,"E")
+28 SET SVRSN=$$GET1^DIQ(90508,BQIDA_",",.08,"E")
+29 SET MVRSN=0
IF UVRSN=SVRSN
SET MVRSN=1
+30 ;
+31 SET II=II+1
SET @DATA@(II)=MVRSN_U_UVRSN_U_SVRSN_$CHAR(30)
+32 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+33 QUIT
+34 ;
USVMCH(DATA,FAKE) ;EP -- BQI SET USER VERSION
+1 ;
+2 ;Description
+3 ; Set the user's iCare GUI version to match the iCare server GUI version
+4 ;
+5 ;Input
+6 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+7 ;Output
+8 ; Returns 1-Successful save/-1 - Unsuccessful save
+9 ;
+10 ;Expects
+11 ; DUZ - the internal entry number of the person signed on
+12 ;
+13 NEW UID,II,BQIDA,SVRSN,BQIUPD,ERROR
+14 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+15 SET DATA=$NAME(^TMP("BQIPLUSR",UID))
+16 KILL @DATA
+17 ;
+18 IF '$$OWNR(DUZ)
SET BMXSEC="There is a problem with your entry."
QUIT
+19 ;
+20 SET II=0
+21 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+22 ;
+23 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLUSR D UNWIND^%ZTER"
+24 ;
+25 SET BQIDA=$$SPM^BQIGPUTL()
+26 SET SVRSN=$$GET1^DIQ(90508,BQIDA_",",.08,"E")
+27 ;
+28 SET BQIUPD(90505,DUZ_",",.17)=SVRSN
+29 ;
+30 DO FILE^DIE("","BQIUPD","ERROR")
+31 KILL BQIUPD
+32 SET II=II+1
+33 IF '$DATA(ERROR)
SET @DATA@(II)="1"_$CHAR(30)
+34 IF $DATA(ERROR)
SET @DATA@(II)="-1"_$CHAR(30)
+35 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+36 QUIT
+37 ;
OWNR(USR) ;EP -- Check owner
+1 ;
+2 ;Description
+3 ; Check if this user who has signed into iCare is already
+4 ; in ICARE USER File #90505
+5 ;Input
+6 ; DUZ - User internal entry number signed into iCare
+7 ;Output
+8 ; 1 - if user exists or if user added okay
+9 ; 0 - if there was an error adding user
+10 ;
+11 IF $GET(^BQICARE(USR,0))'=""
QUIT 1
+12 IF $DATA(^BQICARE(USR))
IF $GET(^BQICARE(USR,0))=""
Begin DoDot:1
+13 NEW DIE,DA,DR
+14 SET DIE="^BQICARE("
SET DA=USR
SET DR=".01///^S X=USR"
DO ^DIE
End DoDot:1
QUIT 1
+15 ;
CR ; Create new entry
+1 NEW IENARRY,BQIUSR,ERROR
+2 SET IENARRY(1)=USR
+3 SET BQIUSR(90505,"+1,",.01)=USR
+4 DO UPDATE^DIE("","BQIUSR","IENARRY","ERROR")
+5 IF $DATA(ERROR)
QUIT 0
+6 QUIT 1