- BQIULSC ;PRXM/HC/BWF - Security Utilities ; 20 Dec 2005 3:54 PM
- ;;2.3;ICARE MANAGEMENT SYSTEM;;Apr 18, 2012;Build 59
- ;
- Q
- ;
- ; NOTE: This function is not currently used, but may be activated at a later date.
- ;
- ; This function will return information on whether or not a user has a given key.
- ; The user and the key to be tested are parameters that are passed into the function.
- ;
- ; INPUT:
- ; KEY - The is the key that we are validating under the user's DUZ.
- ; - This may be passed by IEN or key name.
- ; USER - The DUZ of the user selecting the Health summaries.
- ;
- ;
- ; OUTPUT:
- ; 1 - User has security key
- ; 0 - User does not have security key
- ; -1 - Unable to process request (an error has occurred) such as,
- ; the key does not exist, calling routine should not be checking
- ; for a key that does not exist.
- ;
- KEYCHK(KEY,USER) ;EP
- ; If security key is not numeric, it is assumed that the key was passed by name.
- N KEYIEN,VAL
- I KEY'?1N.N D Q VAL
- .I '$D(^DIC(19.1,"B",KEY)) S VAL=-1 Q
- .S KEYIEN=$O(^DIC(19.1,"B",KEY,0))
- .I '$D(^VA(200,USER,51,KEYIEN)) S VAL=0 Q
- .S VAL=1
- I '$D(^VA(200,USER,51,KEY)) S VAL=0 Q VAL
- S VAL=1
- Q VAL
- ;
- VLDPSW(DATA,PSW) ;EP -- BQI CHECK VERIFY CODE
- NEW UID,II,RESULT
- S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
- S DATA=$NA(^TMP("BQIULSC",UID))
- K @DATA
- NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIULSC D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
- S II=0,@DATA@(II)="I00010RESULT^T00080MESSAGE"_$C(30)
- S PSW=$$DECRYP^XUSRB1(PSW)
- S:'$$GET^XPAR("SYS","XU VC CASE SENSITIVE") PSW=$$UP^XLFSTR(PSW)
- S RESULT=$$EN^XUSHSH(PSW)=$P($G(^VA(200,+DUZ,.1)),U,2)
- ;
- I RESULT=1 S II=II+1,@DATA@(II)="1^"_$C(30)
- E S II=II+1,@DATA@(II)="-1^Incorrect VERIFY CODE"_$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
- BQIULSC ;PRXM/HC/BWF - Security Utilities ; 20 Dec 2005 3:54 PM
- +1 ;;2.3;ICARE MANAGEMENT SYSTEM;;Apr 18, 2012;Build 59
- +2 ;
- +3 QUIT
- +4 ;
- +5 ; NOTE: This function is not currently used, but may be activated at a later date.
- +6 ;
- +7 ; This function will return information on whether or not a user has a given key.
- +8 ; The user and the key to be tested are parameters that are passed into the function.
- +9 ;
- +10 ; INPUT:
- +11 ; KEY - The is the key that we are validating under the user's DUZ.
- +12 ; - This may be passed by IEN or key name.
- +13 ; USER - The DUZ of the user selecting the Health summaries.
- +14 ;
- +15 ;
- +16 ; OUTPUT:
- +17 ; 1 - User has security key
- +18 ; 0 - User does not have security key
- +19 ; -1 - Unable to process request (an error has occurred) such as,
- +20 ; the key does not exist, calling routine should not be checking
- +21 ; for a key that does not exist.
- +22 ;
- KEYCHK(KEY,USER) ;EP
- +1 ; If security key is not numeric, it is assumed that the key was passed by name.
- +2 NEW KEYIEN,VAL
- +3 IF KEY'?1N.N
- Begin DoDot:1
- +4 IF '$DATA(^DIC(19.1,"B",KEY))
- SET VAL=-1
- QUIT
- +5 SET KEYIEN=$ORDER(^DIC(19.1,"B",KEY,0))
- +6 IF '$DATA(^VA(200,USER,51,KEYIEN))
- SET VAL=0
- QUIT
- +7 SET VAL=1
- End DoDot:1
- QUIT VAL
- +8 IF '$DATA(^VA(200,USER,51,KEY))
- SET VAL=0
- QUIT VAL
- +9 SET VAL=1
- +10 QUIT VAL
- +11 ;
- VLDPSW(DATA,PSW) ;EP -- BQI CHECK VERIFY CODE
- +1 NEW UID,II,RESULT
- +2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
- +3 SET DATA=$NAME(^TMP("BQIULSC",UID))
- +4 KILL @DATA
- +5 ; SAC 2006 2.2.3.3.2
- NEW $ESTACK,$ETRAP
- SET $ETRAP="D ERR^BQIULSC D UNWIND^%ZTER"
- +6 SET II=0
- SET @DATA@(II)="I00010RESULT^T00080MESSAGE"_$CHAR(30)
- +7 SET PSW=$$DECRYP^XUSRB1(PSW)
- +8 IF '$$GET^XPAR("SYS","XU VC CASE SENSITIVE")
- SET PSW=$$UP^XLFSTR(PSW)
- +9 SET RESULT=$$EN^XUSHSH(PSW)=$PIECE($GET(^VA(200,+DUZ,.1)),U,2)
- +10 ;
- +11 IF RESULT=1
- SET II=II+1
- SET @DATA@(II)="1^"_$CHAR(30)
- +12 IF '$TEST
- SET II=II+1
- SET @DATA@(II)="-1^Incorrect VERIFY CODE"_$CHAR(30)
- +13 QUIT
- +14 ;
- 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