PRSNEETP ;;WOIFO/JAH - Timekeeper for Nurse Activity for VANOD;7/24/2009
;;4.0;PAID;**126**;Sep 21, 1995;Build 59
;;Per VHA Directive 2004-038, this routine should not be modified.
Q
;
NURSEPOC(TLI,PPI,PRSIEN,PRSDT) ;
;
; Determine if current user (timekeeper) has set toggle to enter POC
; data as they post employee time
;
Q:'$$EDTTOGLD()
;
; Determine if employee passed in PRSIEN is a nurse
;
Q:'$$ISNURSE^PRSNUT01(PRSIEN)
;
; Determine if user has access as a data entry personnel
;
Q:'$D(^PRST(455.5,"AE",DUZ,TLI))
;
; Get Day number of PRSDT-
;
N DAT,PRSD
S DAT=$G(^PRST(458,"AD",PRSDT)),PRSD=$P(DAT,U,2)
;
;Call the POC data entry code
D NURSE^PRSNEE(PPI,PRSIEN,PRSD,"")
Q
EDTTOGLD() ; Check to see if edit POC from Timecard is toggled on.
; look up preference for TKPOCEDIT user preference
;
N TOGGLE,PRSIEN,IENS,SWITCH
S TOGGLE=0
S PRSIEN=$G(^VA(200,DUZ,450))
Q:PRSIEN'>0 TOGGLE
S IENS=","_PRSIEN_","
D FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
I $G(SWITCH("DILIST","ID",1,1))="TRUE" S TOGGLE=1
Q TOGGLE
;
TOGGLE ; Turn On/Off POC Data Entry from Timecard Posting
; called from option PRSN TOGGLE TK POC POST
;
;
N TOGON,PRSIEN,PREFIEN
;
; get current setting
S TOGON=$$EDTTOGLD()
W @IOF,!!!
I TOGON D
. W !?5,"You ARE currently set up to edit"
. W !?5,"Nurse Point of Care records as"
. W !?5,"you post timecards. Do you wish"
. W !?5,"to remove this setting?",!
E D
. W !?5,"You are NOT set up to edit POC"
. W !?5,"records as you post timecards."
. W !?5,"Do you wish to add this"
. W !?5,"capability?",!
;
; ask user if they want to change current preference
N DIR,DIRUT,X,Y
S DIR(0)="Y",DIR("B")="Y" D ^DIR
Q:$D(DIRUT)!('$G(Y))
S PRSIEN=$G(^VA(200,DUZ,450))
S IENS=","_PRSIEN_","
D FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
; if there is an entry for TKPOCEDIT preference then update entry to
; new preference
; otherwise add and set user preference to multiple.
;
I +$G(SWITCH("DILIST",0)) D
. S PREFIEN=+$G(SWITCH("DILIST",2,1))
. N FDA,IENS
. S IENS=PREFIEN_","_PRSIEN_","
. S FDA(450.01,IENS,1)=$S(TOGON:"FALSE",1:"TRUE")
. D UPDATE^DIE("","FDA","IENS"),MSG^DIALOG()
E D
. N FDA,IENS
. S IENS="+1,"_PRSIEN_","
. S FDA(450.01,IENS,.01)="TKPOCEDIT"
. S FDA(450.01,IENS,1)=$S(TOGON:"FALSE",1:"TRUE")
. D UPDATE^DIE("","FDA","IENS"),MSG^DIALOG()
Q
ASSIGNKY(X) ;
; entry point called when user added as a POC Data Entry Personnel
; in the T&L unit file. When added they get the PRSN DEP security key,
; if they don't already have it.
;
S IEN200=$G(X)
Q:IEN200'>0
I '$D(^XUSEC("PRSN DEP",IEN200)) D
. N KEYIEN
. S KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
. Q:'KEYIEN
. S PRSFDA(200.051,"?+1,"_IEN200_",",.01)=KEYIEN
. S PRSIENS(1)=KEYIEN
. D UPDATE^DIE("","PRSFDA","PRSIENS"),MSG^DIALOG()
Q
;
REMOVEKY(DA,X) ;entry point is called when a user is deleted as a POC Data
; Entry Personnel in the T&L unit file. When they are deleted from
; the multiple, the key is removed, unless they are also in another
; T&L as a POC Data Entry Personnel.
;
; Loop thru "AE" xref in case this data entry personnel is assigned
; to other T&Ls
;
N IEN200 S IEN200=$G(X) Q:IEN200'>0
;
N TLI,FOUND S (TLI,FOUND)=0
F S TLI=$O(^PRST(455.5,"AE",IEN200,TLI)) Q:TLI'>0!FOUND D
. I TLI'=""&(TLI'=DA(1)) S FOUND=1
;
I 'FOUND,$D(^XUSEC("PRSN DEP",IEN200)) D
. N KEYIEN,PRSFDA,PRSIENS,DKIEN
. S KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
. Q:'KEYIEN
. S DKIEN=$$FIND1^DIC(200.051,","_IEN200_",","QX",KEYIEN)
. Q:'DKIEN
. S PRSFDA(200.051,DKIEN_","_IEN200_",",.01)="@"
. D FILE^DIE("E","PRSFDA"),MSG^DIALOG()
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSNEETP 3777 printed Oct 16, 2024@18:27:59 Page 2
PRSNEETP ;;WOIFO/JAH - Timekeeper for Nurse Activity for VANOD;7/24/2009
+1 ;;4.0;PAID;**126**;Sep 21, 1995;Build 59
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 QUIT
+4 ;
NURSEPOC(TLI,PPI,PRSIEN,PRSDT) ;
+1 ;
+2 ; Determine if current user (timekeeper) has set toggle to enter POC
+3 ; data as they post employee time
+4 ;
+5 if '$$EDTTOGLD()
QUIT
+6 ;
+7 ; Determine if employee passed in PRSIEN is a nurse
+8 ;
+9 if '$$ISNURSE^PRSNUT01(PRSIEN)
QUIT
+10 ;
+11 ; Determine if user has access as a data entry personnel
+12 ;
+13 if '$DATA(^PRST(455.5,"AE",DUZ,TLI))
QUIT
+14 ;
+15 ; Get Day number of PRSDT-
+16 ;
+17 NEW DAT,PRSD
+18 SET DAT=$GET(^PRST(458,"AD",PRSDT))
SET PRSD=$PIECE(DAT,U,2)
+19 ;
+20 ;Call the POC data entry code
+21 DO NURSE^PRSNEE(PPI,PRSIEN,PRSD,"")
+22 QUIT
EDTTOGLD() ; Check to see if edit POC from Timecard is toggled on.
+1 ; look up preference for TKPOCEDIT user preference
+2 ;
+3 NEW TOGGLE,PRSIEN,IENS,SWITCH
+4 SET TOGGLE=0
+5 SET PRSIEN=$GET(^VA(200,DUZ,450))
+6 if PRSIEN'>0
QUIT TOGGLE
+7 SET IENS=","_PRSIEN_","
+8 DO FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
+9 IF $GET(SWITCH("DILIST","ID",1,1))="TRUE"
SET TOGGLE=1
+10 QUIT TOGGLE
+11 ;
TOGGLE ; Turn On/Off POC Data Entry from Timecard Posting
+1 ; called from option PRSN TOGGLE TK POC POST
+2 ;
+3 ;
+4 NEW TOGON,PRSIEN,PREFIEN
+5 ;
+6 ; get current setting
+7 SET TOGON=$$EDTTOGLD()
+8 WRITE @IOF,!!!
+9 IF TOGON
Begin DoDot:1
+10 WRITE !?5,"You ARE currently set up to edit"
+11 WRITE !?5,"Nurse Point of Care records as"
+12 WRITE !?5,"you post timecards. Do you wish"
+13 WRITE !?5,"to remove this setting?",!
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 WRITE !?5,"You are NOT set up to edit POC"
+16 WRITE !?5,"records as you post timecards."
+17 WRITE !?5,"Do you wish to add this"
+18 WRITE !?5,"capability?",!
End DoDot:1
+19 ;
+20 ; ask user if they want to change current preference
+21 NEW DIR,DIRUT,X,Y
+22 SET DIR(0)="Y"
SET DIR("B")="Y"
DO ^DIR
+23 if $DATA(DIRUT)!('$GET(Y))
QUIT
+24 SET PRSIEN=$GET(^VA(200,DUZ,450))
+25 SET IENS=","_PRSIEN_","
+26 DO FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
+27 ; if there is an entry for TKPOCEDIT preference then update entry to
+28 ; new preference
+29 ; otherwise add and set user preference to multiple.
+30 ;
+31 IF +$GET(SWITCH("DILIST",0))
Begin DoDot:1
+32 SET PREFIEN=+$GET(SWITCH("DILIST",2,1))
+33 NEW FDA,IENS
+34 SET IENS=PREFIEN_","_PRSIEN_","
+35 SET FDA(450.01,IENS,1)=$SELECT(TOGON:"FALSE",1:"TRUE")
+36 DO UPDATE^DIE("","FDA","IENS")
DO MSG^DIALOG()
End DoDot:1
+37 IF '$TEST
Begin DoDot:1
+38 NEW FDA,IENS
+39 SET IENS="+1,"_PRSIEN_","
+40 SET FDA(450.01,IENS,.01)="TKPOCEDIT"
+41 SET FDA(450.01,IENS,1)=$SELECT(TOGON:"FALSE",1:"TRUE")
+42 DO UPDATE^DIE("","FDA","IENS")
DO MSG^DIALOG()
End DoDot:1
+43 QUIT
ASSIGNKY(X) ;
+1 ; entry point called when user added as a POC Data Entry Personnel
+2 ; in the T&L unit file. When added they get the PRSN DEP security key,
+3 ; if they don't already have it.
+4 ;
+5 SET IEN200=$GET(X)
+6 if IEN200'>0
QUIT
+7 IF '$DATA(^XUSEC("PRSN DEP",IEN200))
Begin DoDot:1
+8 NEW KEYIEN
+9 SET KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
+10 if 'KEYIEN
QUIT
+11 SET PRSFDA(200.051,"?+1,"_IEN200_",",.01)=KEYIEN
+12 SET PRSIENS(1)=KEYIEN
+13 DO UPDATE^DIE("","PRSFDA","PRSIENS")
DO MSG^DIALOG()
End DoDot:1
+14 QUIT
+15 ;
REMOVEKY(DA,X) ;entry point is called when a user is deleted as a POC Data
+1 ; Entry Personnel in the T&L unit file. When they are deleted from
+2 ; the multiple, the key is removed, unless they are also in another
+3 ; T&L as a POC Data Entry Personnel.
+4 ;
+5 ; Loop thru "AE" xref in case this data entry personnel is assigned
+6 ; to other T&Ls
+7 ;
+8 NEW IEN200
SET IEN200=$GET(X)
if IEN200'>0
QUIT
+9 ;
+10 NEW TLI,FOUND
SET (TLI,FOUND)=0
+11 FOR
SET TLI=$ORDER(^PRST(455.5,"AE",IEN200,TLI))
if TLI'>0!FOUND
QUIT
Begin DoDot:1
+12 IF TLI'=""&(TLI'=DA(1))
SET FOUND=1
End DoDot:1
+13 ;
+14 IF 'FOUND
IF $DATA(^XUSEC("PRSN DEP",IEN200))
Begin DoDot:1
+15 NEW KEYIEN,PRSFDA,PRSIENS,DKIEN
+16 SET KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
+17 if 'KEYIEN
QUIT
+18 SET DKIEN=$$FIND1^DIC(200.051,","_IEN200_",","QX",KEYIEN)
+19 if 'DKIEN
QUIT
+20 SET PRSFDA(200.051,DKIEN_","_IEN200_",",.01)="@"
+21 DO FILE^DIE("E","PRSFDA")
DO MSG^DIALOG()
End DoDot:1
+22 QUIT