AGGPTSEN ;VNGT/HS/ALA-Sensitive Patient Options ; 20 Apr 2010 1:21 PM
;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
;;
;
Q
;
CHK(DATA,DFN) ; EP -- AGG CHECK SENSITIVE PATIENT
;Description
; Checks whether a patient with a sensitive flag is accessible by
; this user or not
;
;Input
; DFN = Patient IEN
; Assumes DUZ
;Output
; 0 = is not really sensitive
; 1 = is sensitive but DUZ has key that allows access
; 2 = is sensitive but DUZ does not have key that allows access
; so if user continues on, a record must be logged
;
NEW UID,II,TEXT,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGPTSEN",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGPTSEN D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00001SENSITIVE_INDICATOR"_$C(30)
D SENS^DGSEC4(.TEXT,DFN,DUZ)
S II=II+1,@DATA@(II)=$G(TEXT(1))_$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
;
NOT(DATA,DFN) ; EP -- AGG SEND SENSITIVE NOTIFY
;Description
; Send sensitive patient notification
;Input
; DFN - Patient IEN
; Assumes DUZ
;
NEW UID,II,RESULT
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGPTSEN",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGPTSEN D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010RESULT"_$C(30)
D NOTICE^DGSEC4(.RESULT,DFN,"AGGRPC^AGG RPC Calls")
S II=II+1,@DATA@(II)=RESULT_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
AGGPTSEN ;VNGT/HS/ALA-Sensitive Patient Options ; 20 Apr 2010 1:21 PM
+1 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
+2 ;;
+3 ;
+4 QUIT
+5 ;
CHK(DATA,DFN) ; EP -- AGG CHECK SENSITIVE PATIENT
+1 ;Description
+2 ; Checks whether a patient with a sensitive flag is accessible by
+3 ; this user or not
+4 ;
+5 ;Input
+6 ; DFN = Patient IEN
+7 ; Assumes DUZ
+8 ;Output
+9 ; 0 = is not really sensitive
+10 ; 1 = is sensitive but DUZ has key that allows access
+11 ; 2 = is sensitive but DUZ does not have key that allows access
+12 ; so if user continues on, a record must be logged
+13 ;
+14 NEW UID,II,TEXT,X
+15 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+16 SET DATA=$NAME(^TMP("AGGPTSEN",UID))
+17 KILL @DATA
+18 ;
+19 SET II=0
+20 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGPTSEN D UNWIND^%ZTER"
+21 ;
+22 SET @DATA@(II)="T00001SENSITIVE_INDICATOR"_$CHAR(30)
+23 DO SENS^DGSEC4(.TEXT,DFN,DUZ)
+24 SET II=II+1
SET @DATA@(II)=$GET(TEXT(1))_$CHAR(30)
+25 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+26 QUIT
+27 ;
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 ;
NOT(DATA,DFN) ; EP -- AGG SEND SENSITIVE NOTIFY
+1 ;Description
+2 ; Send sensitive patient notification
+3 ;Input
+4 ; DFN - Patient IEN
+5 ; Assumes DUZ
+6 ;
+7 NEW UID,II,RESULT
+8 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+9 SET DATA=$NAME(^TMP("AGGPTSEN",UID))
+10 KILL @DATA
+11 ;
+12 SET II=0
+13 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGPTSEN D UNWIND^%ZTER"
+14 ;
+15 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+16 DO NOTICE^DGSEC4(.RESULT,DFN,"AGGRPC^AGG RPC Calls")
+17 SET II=II+1
SET @DATA@(II)=RESULT_$CHAR(30)
+18 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+19 QUIT