Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRSNEETP

PRSNEETP.m

Go to the documentation of this file.
  1. PRSNEETP ;;WOIFO/JAH - Timekeeper for Nurse Activity for VANOD;7/24/2009
  1. ;;4.0;PAID;**126**;Sep 21, 1995;Build 59
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. NURSEPOC(TLI,PPI,PRSIEN,PRSDT) ;
  1. ;
  1. ; Determine if current user (timekeeper) has set toggle to enter POC
  1. ; data as they post employee time
  1. ;
  1. Q:'$$EDTTOGLD()
  1. ;
  1. ; Determine if employee passed in PRSIEN is a nurse
  1. ;
  1. Q:'$$ISNURSE^PRSNUT01(PRSIEN)
  1. ;
  1. ; Determine if user has access as a data entry personnel
  1. ;
  1. Q:'$D(^PRST(455.5,"AE",DUZ,TLI))
  1. ;
  1. ; Get Day number of PRSDT-
  1. ;
  1. N DAT,PRSD
  1. S DAT=$G(^PRST(458,"AD",PRSDT)),PRSD=$P(DAT,U,2)
  1. ;
  1. ;Call the POC data entry code
  1. D NURSE^PRSNEE(PPI,PRSIEN,PRSD,"")
  1. Q
  1. EDTTOGLD() ; Check to see if edit POC from Timecard is toggled on.
  1. ; look up preference for TKPOCEDIT user preference
  1. ;
  1. N TOGGLE,PRSIEN,IENS,SWITCH
  1. S TOGGLE=0
  1. S PRSIEN=$G(^VA(200,DUZ,450))
  1. Q:PRSIEN'>0 TOGGLE
  1. S IENS=","_PRSIEN_","
  1. D FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
  1. I $G(SWITCH("DILIST","ID",1,1))="TRUE" S TOGGLE=1
  1. Q TOGGLE
  1. ;
  1. TOGGLE ; Turn On/Off POC Data Entry from Timecard Posting
  1. ; called from option PRSN TOGGLE TK POC POST
  1. ;
  1. ;
  1. N TOGON,PRSIEN,PREFIEN
  1. ;
  1. ; get current setting
  1. S TOGON=$$EDTTOGLD()
  1. W @IOF,!!!
  1. I TOGON D
  1. . W !?5,"You ARE currently set up to edit"
  1. . W !?5,"Nurse Point of Care records as"
  1. . W !?5,"you post timecards. Do you wish"
  1. . W !?5,"to remove this setting?",!
  1. E D
  1. . W !?5,"You are NOT set up to edit POC"
  1. . W !?5,"records as you post timecards."
  1. . W !?5,"Do you wish to add this"
  1. . W !?5,"capability?",!
  1. ;
  1. ; ask user if they want to change current preference
  1. N DIR,DIRUT,X,Y
  1. S DIR(0)="Y",DIR("B")="Y" D ^DIR
  1. Q:$D(DIRUT)!('$G(Y))
  1. S PRSIEN=$G(^VA(200,DUZ,450))
  1. S IENS=","_PRSIEN_","
  1. D FIND^DIC(450.01,IENS,"1",,"TKPOCEDIT",,,,,"SWITCH",)
  1. ; if there is an entry for TKPOCEDIT preference then update entry to
  1. ; new preference
  1. ; otherwise add and set user preference to multiple.
  1. ;
  1. I +$G(SWITCH("DILIST",0)) D
  1. . S PREFIEN=+$G(SWITCH("DILIST",2,1))
  1. . N FDA,IENS
  1. . S IENS=PREFIEN_","_PRSIEN_","
  1. . S FDA(450.01,IENS,1)=$S(TOGON:"FALSE",1:"TRUE")
  1. . D UPDATE^DIE("","FDA","IENS"),MSG^DIALOG()
  1. E D
  1. . N FDA,IENS
  1. . S IENS="+1,"_PRSIEN_","
  1. . S FDA(450.01,IENS,.01)="TKPOCEDIT"
  1. . S FDA(450.01,IENS,1)=$S(TOGON:"FALSE",1:"TRUE")
  1. . D UPDATE^DIE("","FDA","IENS"),MSG^DIALOG()
  1. Q
  1. ASSIGNKY(X) ;
  1. ; entry point called when user added as a POC Data Entry Personnel
  1. ; in the T&L unit file. When added they get the PRSN DEP security key,
  1. ; if they don't already have it.
  1. ;
  1. S IEN200=$G(X)
  1. Q:IEN200'>0
  1. I '$D(^XUSEC("PRSN DEP",IEN200)) D
  1. . N KEYIEN
  1. . S KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
  1. . Q:'KEYIEN
  1. . S PRSFDA(200.051,"?+1,"_IEN200_",",.01)=KEYIEN
  1. . S PRSIENS(1)=KEYIEN
  1. . D UPDATE^DIE("","PRSFDA","PRSIENS"),MSG^DIALOG()
  1. Q
  1. ;
  1. 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
  1. ; the multiple, the key is removed, unless they are also in another
  1. ; T&L as a POC Data Entry Personnel.
  1. ;
  1. ; Loop thru "AE" xref in case this data entry personnel is assigned
  1. ; to other T&Ls
  1. ;
  1. N IEN200 S IEN200=$G(X) Q:IEN200'>0
  1. ;
  1. N TLI,FOUND S (TLI,FOUND)=0
  1. F S TLI=$O(^PRST(455.5,"AE",IEN200,TLI)) Q:TLI'>0!FOUND D
  1. . I TLI'=""&(TLI'=DA(1)) S FOUND=1
  1. ;
  1. I 'FOUND,$D(^XUSEC("PRSN DEP",IEN200)) D
  1. . N KEYIEN,PRSFDA,PRSIENS,DKIEN
  1. . S KEYIEN=$$FIND1^DIC(19.1,,"X","PRSN DEP")
  1. . Q:'KEYIEN
  1. . S DKIEN=$$FIND1^DIC(200.051,","_IEN200_",","QX",KEYIEN)
  1. . Q:'DKIEN
  1. . S PRSFDA(200.051,DKIEN_","_IEN200_",",.01)="@"
  1. . D FILE^DIE("E","PRSFDA"),MSG^DIALOG()
  1. Q