BDGSPT3 ; IHS/OIT/LJF - DISPLAY USER'S REESTRICTION TO A SPECIFIC PATIENT
;;5.3;PIMS;**1008,1009**;MAY 28, 2004
;IHS/OIT/LJF 08/23/2007 ROUTINE ADDED with Patch 1008
;
EN ;EP; -- main entry point for BDG SECURITY VIEW RESTRICTIONS
; assumes DFN and BDGSUR already set
; called by ^BDGSPT2 for view action
NEW VALMCNT D TERM^VALM0,CLEAR^VALM1
D EN^VALM("BDG SECURITY VIEW RESTRICTIONS")
D CLEAR^VALM1
Q
;
HDR ;EP; -- header code
NEW X
S X=$$GET1^DIQ(200,+$G(BDGUSR),.01)
S VALMHDR(1)=$$PAD("User:",12)_X_$$SP(7)_$$GET1^DIQ(200,+$G(BDGUSR),8)
S VALMHDR(2)=$$SP(12)_"Last Signed on "_$$GET1^DIQ(200,+$G(BDGUSR),202)
S VALMHDR(3)=""
S VALMHDR(4)=$$PAD("Patient:",12)_$$GET1^DIQ(2,DFN,.01)_" ("_$$STATUS^BDGSPT2(BDGUSR,DFN,2)_")"
Q
;
INIT ;EP; -- init variables and list array
S VALMCNT=0 K ^TMP("BDGSPT3",$J)
;
NEW DTSTAMP,LINE,IENS,LIFT,USER,RESUME
; display when patient record was first restricted
S LINE=" "_$$GET1^DIQ(9009018.11,DFN_","_BDGUSR,.02)
S LINE=$$PAD(LINE,66)_$$GET1^DIQ(9009018.11,DFN_","_BDGUSR,.03) ;user who added it
D SET(LINE,.VALMCNT)
;
; find all activity on this record & add to display array
S DTSTAMP=0 F S DTSTAMP=$O(^BDGSPT(BDGUSR,1,DFN,1,DTSTAMP)) Q:'DTSTAMP D
. S IENS=DTSTAMP_","_DFN_","_BDGUSR
. S LIFT=$$GET1^DIQ(9009018.111,IENS,.03) ;date restriction lifted
. S USER=$$GET1^DIQ(9009018.111,IENS,.02) ;user
. S USER2=$$GET1^DIQ(9009018.111,IENS,.08) ;user who last edited
. S LINE=$$PAD($$SP(24)_LIFT,47)
. S LINE=$$PAD(LINE,66)_$S(USER2]"":USER2,1:USER)
. D SET(LINE,.VALMCNT)
. ;
. S RESUME=$$GET1^DIQ(9009018.111,IENS,.04) ;date restriction resumes
. I RESUME]"" D
. . S USER=$$GET1^DIQ(9009018.111,IENS,.06) ;user
. . S LINE=$$SP(47)_RESUME
. . S LINE=$$PAD(LINE,66)_USER
. . D SET(LINE,.VALMCNT)
;
I '$D(^TMP("BDGSPT3",$J)) S VALMCNT=1,^TMP("BDGSPT3",$J,1,0)=$$SP(15)_"NO INFORMATION FOUND"
Q
;
SET(LINE,NUM) ; put display line into array
S NUM=NUM+1
S ^TMP("BDGSPT3",$J,NUM,0)=LINE
Q
;
HELP ;EP; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ;EP; -- exit code
K ^TMP("BDGSPT3",$J)
Q
;
EXPND ;EP; -- expand code
Q
;
PAD(D,L) ; -- SUBRTN to pad length of data
; -- D=data L=length
Q $E(D_$$REPEAT^XLFSTR(" ",L),1,L)
;
SP(N) ; -- SUBRTN to pad N number of spaces
Q $$PAD(" ",N)
BDGSPT3 ; IHS/OIT/LJF - DISPLAY USER'S REESTRICTION TO A SPECIFIC PATIENT
+1 ;;5.3;PIMS;**1008,1009**;MAY 28, 2004
+2 ;IHS/OIT/LJF 08/23/2007 ROUTINE ADDED with Patch 1008
+3 ;
EN ;EP; -- main entry point for BDG SECURITY VIEW RESTRICTIONS
+1 ; assumes DFN and BDGSUR already set
+2 ; called by ^BDGSPT2 for view action
+3 NEW VALMCNT
DO TERM^VALM0
DO CLEAR^VALM1
+4 DO EN^VALM("BDG SECURITY VIEW RESTRICTIONS")
+5 DO CLEAR^VALM1
+6 QUIT
+7 ;
HDR ;EP; -- header code
+1 NEW X
+2 SET X=$$GET1^DIQ(200,+$GET(BDGUSR),.01)
+3 SET VALMHDR(1)=$$PAD("User:",12)_X_$$SP(7)_$$GET1^DIQ(200,+$GET(BDGUSR),8)
+4 SET VALMHDR(2)=$$SP(12)_"Last Signed on "_$$GET1^DIQ(200,+$GET(BDGUSR),202)
+5 SET VALMHDR(3)=""
+6 SET VALMHDR(4)=$$PAD("Patient:",12)_$$GET1^DIQ(2,DFN,.01)_" ("_$$STATUS^BDGSPT2(BDGUSR,DFN,2)_")"
+7 QUIT
+8 ;
INIT ;EP; -- init variables and list array
+1 SET VALMCNT=0
KILL ^TMP("BDGSPT3",$JOB)
+2 ;
+3 NEW DTSTAMP,LINE,IENS,LIFT,USER,RESUME
+4 ; display when patient record was first restricted
+5 SET LINE=" "_$$GET1^DIQ(9009018.11,DFN_","_BDGUSR,.02)
+6 ;user who added it
SET LINE=$$PAD(LINE,66)_$$GET1^DIQ(9009018.11,DFN_","_BDGUSR,.03)
+7 DO SET(LINE,.VALMCNT)
+8 ;
+9 ; find all activity on this record & add to display array
+10 SET DTSTAMP=0
FOR
SET DTSTAMP=$ORDER(^BDGSPT(BDGUSR,1,DFN,1,DTSTAMP))
IF 'DTSTAMP
QUIT
Begin DoDot:1
+11 SET IENS=DTSTAMP_","_DFN_","_BDGUSR
+12 ;date restriction lifted
SET LIFT=$$GET1^DIQ(9009018.111,IENS,.03)
+13 ;user
SET USER=$$GET1^DIQ(9009018.111,IENS,.02)
+14 ;user who last edited
SET USER2=$$GET1^DIQ(9009018.111,IENS,.08)
+15 SET LINE=$$PAD($$SP(24)_LIFT,47)
+16 SET LINE=$$PAD(LINE,66)_$SELECT(USER2]"":USER2,1:USER)
+17 DO SET(LINE,.VALMCNT)
+18 ;
+19 ;date restriction resumes
SET RESUME=$$GET1^DIQ(9009018.111,IENS,.04)
+20 IF RESUME]""
Begin DoDot:2
+21 ;user
SET USER=$$GET1^DIQ(9009018.111,IENS,.06)
+22 SET LINE=$$SP(47)_RESUME
+23 SET LINE=$$PAD(LINE,66)_USER
+24 DO SET(LINE,.VALMCNT)
End DoDot:2
End DoDot:1
+25 ;
+26 IF '$DATA(^TMP("BDGSPT3",$JOB))
SET VALMCNT=1
SET ^TMP("BDGSPT3",$JOB,1,0)=$$SP(15)_"NO INFORMATION FOUND"
+27 QUIT
+28 ;
SET(LINE,NUM) ; put display line into array
+1 SET NUM=NUM+1
+2 SET ^TMP("BDGSPT3",$JOB,NUM,0)=LINE
+3 QUIT
+4 ;
HELP ;EP; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ;EP; -- exit code
+1 KILL ^TMP("BDGSPT3",$JOB)
+2 QUIT
+3 ;
EXPND ;EP; -- expand code
+1 QUIT
+2 ;
PAD(D,L) ; -- SUBRTN to pad length of data
+1 ; -- D=data L=length
+2 QUIT $EXTRACT(D_$$REPEAT^XLFSTR(" ",L),1,L)
+3 ;
SP(N) ; -- SUBRTN to pad N number of spaces
+1 QUIT $$PAD(" ",N)