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

AZAXKEY.m

Go to the documentation of this file.
AZAXKEY ;IHS/PHXAO/AEF - PRINT SECURITY KEYS AND MENUS OF SELECTED EMPLOYEE
 ;;1.0;PHXAO LOCAL ROUTINES;;OCT 12, 2004
 ;
DESC ;----- ROUTINE DESCRIPTION
 ;;
 ;;This routine prints a form listing the selected employee's security
 ;;keys and the menu options that the employee has access to.
 ;;
 ;;$$END
 ;
 N I,X
 F I=1:1 S X=$T(DESC+I) Q:X["$$END"  W !,$P(X,";;",2)
 Q
EN ;EP -- MAIN ENTRY POINT
 ;
 N Y
 D ^XBKVAR
 D HOME^%ZIS
 ;
 D DESC
 ;
 D SEL(.Y)
 Q:+Y'>0
 S AZAXDUZ=+Y
 ;
 Q
SEL(Y) ;
 ;----- SELECT THE EMPLOYEE
 ;
 N DIC,X
 S DIC="^VA(200,"
 S DIC(0)="AEMQ"
 D ^DIC
 Q Y
DQ ;EP -- QUEUED JOB STARTS HERE
 ;
 N AZAXOUT,AZAXPAGE,AZAXTTL1
 ;
 D ^XBKVAR
 D HOME^%ZIS
 ;
 S AZAXOUT=0
 S AZAXPAGE=0
 S AZAXTTL1="                           RPMS COMPUTER ACCESS FORM"
 S AZAXTTL2=""
 ;
 D KEYS(AZAXDUZ)
 D HDR(AZAXTTL1,AZAXTTL2,.AZAXPAGE,.AZAXOUT)
 D PKEYS(AZAXDUZ,AZAXTTL1,.AZAXPAGE,.AZAXOUT)
 ;
 D MENUS(AZAXDUZ) 
 Q
KEYS(AZAXDUZ) ;
 ;----- GET A USER'S KEYS AND STORE THEM ALPHABETICALLY IN ^TMP
 ;
 S AZAXKEY=0
 F  S AZAXKEY=$O(^VA(200,AZAXDUZ,51,AZAXKEY)) Q:'AZAXKEY  D
 . S AZAXKEYN=$P($G(^DIC(19.1,AZAXKEY,0)),U)
 . Q:AZAXKEYN']""
 . S ^TMP("AZAX",$J,AZAXDUZ,"KEYS",AZAXKEYN,0)=AZAXKEY
 Q
PKEYS(AZAXDUZ,AZAXTTL1,AZAXPAGE,AZAXOUT) ;
 ;----- PRINT A USER'S KEYS
 ;
 S AZAXTTL2="SECURITY KEYS FOR "_$P($G(^VA(200,AZAXDUZ,0)),U)_":"
 S AZAXPAGE=0
 S AZAXOUT=0
 S AZAXCNT=0
 S AZAXCOL=0
 S AZAXKEYN=""
 F  S AZAXKEYN=$O(^TMP("AZAX",$J,AZAXDUZ,"KEYS",AZAXKEYN)) Q:AZAXKEYN']""  D  Q:AZAXOUT
 . S AZAXCNT=AZAXCNT+1
 . I AZAXCNT>3 S AZAXCNT=1
 . S AZAXCOL=$P("1^28^55",U,AZAXCNT)
 . I AZAXCOL=1 W !
 . I $Y>(IOSL-5) D HDR(AZAXTTL1,AZAXTTL2,.AZAXPAGE,.AZAXOUT)
 . Q:AZAXOUT
 . W ?AZAXCOL,$E(AZAXKEYN,1,25)
 I 'AZAXCNT D
 . W !?5,"THIS USER POSSESSES NO SECURITY KEYS",!
 Q
 ;----- GETS A USER'S MENU OPTIONS
 ;
 Q
HDR(AZAXTTL1,AZAXTTL2,AZAXPAGE,AZAXOUT) ;
 ;----- WRITE HEADER
 ;
 N DIR,X,Y
 ;
 I $E(IOST)="C",$G(AZAXPAGE) D
 . S DIR(0)="E"
 . D ^DIR
 . K DIR
 . I 'Y S AZAXOUT=1
 Q:$G(AZAXOUT)
 ;
 S AZAXPAGE=$G(AZAXPAGE)+1
 W @IOF
 W !,AZAXTTL1
 W ?(IOM-10),"PAGE ",AZAXPAGE
 W !!,AZAXTTL2
 W !
 ;F I=1:1:IOM W "-"
 W !
 Q