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

ACRFACC.m

Go to the documentation of this file.
ACRFACC ;IHS/OIRM/DSD/THL,AEF - DEFINE ARMS USER BY ACCESS LEVEL;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ALLOWS SYSTEMS MANAGER TO DEFINE ACCESS LEVEL FOR ARMS USER
 ;;SECURITY KEYS ARE ASSIGNED ACCORDING TO ACCESS LEVEL
EN ;EP;FOR MULTIPLE USER SETUP
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRI,ACRJ,ACRZ,ACRLVL,ACRLVLDA,ACRTXDA,DINUM,ACRQUIT,ACR,ACRNWLVL,ACRACC,ACRII,ACRDEPT,ACRY
 Q
EN1 W @IOF
EN11 ;EP;
 W !?22,"ESTABLISH USER ACCESS LEVEL"
 W !?22,"==========================="
 W !
 S DIC="^VA(200,"
 S DIC(0)="AEMQZ"
 S DIC("A")="EMPLOYEE............: "
 D DIC^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S ACRDUZ=+Y
 S ACRUSER=Y(0,0)
 S ACRUSER=$P(ACRUSER,",",2)_" "_$P(ACRUSER,",")
EN2 ;EP;FOR SINGLE USER SETUP, USER MUST BE DEFINED PER:
 ;ACRDUZ = DUZ OF PERSON BEING ASSIGNED ACCESS LEVEL
 ;ACRUSER = NAME OF           "
 D DISPLAY
 D ACCLVL
 W !!?5,ACRUSER," has been assigned "
 W $S($D(ACRLVL):ACRLVL,1:"NO")," access to ARMS."
 H 2
 D EXIT
 Q
DISPLAY ;DISPLAYS ESTABLISHED ACCESS LEVELS
 W !!?10,"CODE"
 W ?16,"LEVEL"
 W ?26,"LEVEL NAME"
 W !?10,"----"
 W ?16,"--------"
 W ?26,"------------------------------"
 S ACR=0
 F  S ACR=$O(^ACRACC("C",ACR)) Q:'ACR  D
 .S ACRDA=0
 .F  S ACRDA=$O(^ACRACC("C",ACR,ACRDA)) Q:'ACRDA  D
 ..S ACRACC=^ACRACC(ACRDA,0)
 ..W !?10,$P(ACRACC,U,2)
 ..W ?16,$P(ACRACC,U)
 ..W ?26,$P(ACRACC,U,3)
 Q
ACCLVL ;SELECTS ACCESS LEVEL
 I $D(^ACRUAL("LVL",ACRDUZ)) D OLDLVL Q:$D(ACRLVLDA)
 I '$D(^ACRUAL("LVL",ACRDUZ)),$D(^ACRUAL(ACRDUZ,0)) D
 .S ACRNWLVL=""
 .D ACCESS
 .K ACRNWLVL
 S DIR(0)="LOA^1:10:1"
 S:'$D(^ACRUAL("LVL",DUZ,3)) DIR(0)="LOA^1:9:1"
 S DIR("A")="Access level(S)....:  "
 W !
 D DIR^ACRFDIC
 Q:+Y<1
 S ACRX=Y
 F ACRJ=1:1 S ACRZ=$P(ACRX,",",ACRJ) Q:ACRZ=""  D
 .S ACRLVL=ACRZ
 .S ACRLVLDA=$O(^ACRACC("C",ACRLVL,0))
 .D:ACRLVLDA SET
 Q
SET ;EP;TO KILL OLD ACCESS LEVEL AND DELETE USER AS HOLDER OF SECURITY KEYS
 ;AND TO SET NEW LEVEL AND ADD USER AS HOLDER OF SECURITY KEYS
 D SETKILL
ACCESS ;EP;TO SET ACCESS LEVEL
 S:$D(^ACRUAL("LVL",ACRDUZ,3)) ACRLVL=3
 S (X,DA,DINUM)=ACRDUZ
 S ACRD=$S('$D(ACRNWLVL):"FILE",1:"DIK")
 S (DIC,DIK)="^ACRUAL("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRLVLDA
 D @ACRD^ACRFDIC
 K:$D(ACRNWLVL) ^ACRUAL("LVL",ACRDUZ)
 S:$G(ACRLVLDA)=3 ^ACRUAL("LVL",ACRDUZ,3,ACRDUZ)=""
 S ^ACRUAL("LVL",ACRDUZ,ACRLVLDA,ACRDUZ)=""
 K ACRNWLVL,ACRLVLDA,DR,ACRD
 Q
OLDLVL ;DISPLAYS EXISTING ACCESS LEVEL AND QUERIES TO CHANGE ACCESS LEVEL
 S ACRLVLDA=$O(^ACRUAL("LVL",ACRDUZ,""))
 I 'ACRLVLDA K ^ACRUAL("LVL",ACRDUZ),ACRLVLDA Q
 I '$D(^ACRUAL(ACRDUZ,0)) K ^ACRUAL("LVL",ACRDUZ),ACRLVLDA Q
 S ACRLVL=$P(^ACRACC(ACRLVLDA,0),U)
 W !!?5,ACRUSER," has ",ACRLVL," access"
 I $O(^ACRUAL("LVL",ACRDUZ,ACRLVLDA)) D
 .N X
 .S X=ACRLVLDA
 .F  S X=$O(^ACRUAL("LVL",ACRDUZ,X)) Q:'X  D
 ..W !?($L(ACRUSER)+6),"and ",$P($G(^ACRACC(X,0)),U)," access"
 S DIR(0)="YO"
 S DIR("B")="NO"
 S DIR("A")="     Want to change this level"
 D DIR^ACRFDIC
 I Y'=1 K ACRQUIT Q
 K ^ACRUAL("LVL",ACRDUZ)
 S ACRNWLVL=""
 D SET
 K ACRNWLVL,ACRLVLDA,DR
 Q
SETSEC ; ASSIGN XUSR THIS SECURITY KEY
 S (X,DINUM)=ACRI
 S DA(1)=ACRDUZ
 S DIC="^VA(200,"_DA(1)_",51,"
 S DIC(0)="L"
 S DIC("DR")="1////.5;2////"_DT_";3////"_DT
 I '$D(^VA(200,DA(1),51,X,0)) D
 .S:'$D(@(DIC_"0)")) @(DIC_"0)")="^200.051PA"
 .D FILE^ACRFDIC
 Q
KILLSEC ;EP;DELETES USER AS HOLDER OF THE SECURITY KEY
 N ACRI
 S ACRI=0
 F  S ACRI=$O(^VA(200,ACRDUZ,51,ACRI)) Q:'ACRI  D
 .I $D(^VA(200,ACRDUZ,51,ACRI,0)),$E($G(^DIC(19.1,ACRI,0)),1,4)="ACRZ" D
 ..S DA(1)=ACRDUZ
 ..S DA=ACRI
 ..S DIK="^VA(200,"_ACRDUZ_",51,"
 ..D DIK^ACRFDIC
 ..K ^DIC(19.1,"D",ACRDUZ,ACRI)
 Q
SETKILL ;EP;
 I '$D(ACRNWLVL)&$D(ACRLVL)#2 D
 .W !!,"ACCESS LEVEL ",ACRLVL," BEING ASSIGNED..."
 K DR
 S ACRI=0
 F  S ACRI=$O(^ACRACC(ACRLVLDA,"SEC",ACRI)) Q:'ACRI  D
 .D SETSEC:'$D(ACRNWLVL)
 .D KILLSEC:$D(ACRNWLVL)
 Q
DELETE ;EP;TO DELETE USERS ACCESS TO ARMS INCLUDING ACCESS LEVEL, SECURITY
 ;KEYS AND ACCOUNT ACCESS
 S:'$D(^ACRPO(1,50,0))#2 ^ACRPO(1,50,0)="^9002199.4501P"
 S X=DUZ
 S DIC="^ACRPO(1,50,"
 S DIC(0)="L"
 S DIC("DR")=".02///NOW",DA(1)=1
 D FILE^ACRFDIC
 S ACRAAUD=+Y
 D WARNING^ACRFWARN
 W !!,"The following procedure will delete all access this users has to ARMS."
 S DIR(0)="YO"
 S DIR("A")="Are you certain this is what you want to do"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 S DA=ACRAAUD
 S DIE="^ACRPO(1,50,"
 S DR=".03////1;.04////"_ACRDUZ
 D DIE^ACRFDIC
 S ACRNWLVL=""
 S ACRLVLDA=3
 W !!,"ARMS related SECURITY KEYS being withdrawn."
 D SETKILL
 W !,"ARMS APPROVAL AUTHORITIES being deleted."
 S ACRDA=0
 F  S ACRDA=$O(^ACRAPL("B",ACRDUZ,ACRDA)) Q:'ACRDA  D
 .S DA=ACRDA
 .S DIK="^ACRAPL("
 .D DIK^ACRFDIC
 W !,"Authority to sign as an ALTERNATE for someone else being deleted."
 S ACRDA=0
 F  S ACRDA=$O(^ACRAPL("SEC",ACRDUZ,ACRDA)) Q:'ACRDA  D
 .S DA=ACRDA
 .S DIE="^ACRAPL("
 .F X=1:1:4 D:$P(^ACRAPL(DA,"DT"),U,X)=ACRDUZ
 ..S DR=$G(DR)_X_"///@;"
 .D DIE^ACRFDIC
 W !,"ARMS ACCESS LEVEL being deleted."
 S ACRDA=0
 F  S ACRDA=$O(^ACRUAL("B",ACRDUZ,ACRDA)) Q:'ACRDA  D
 .S DA=ACRDA
 .S DIK="^ACRUAL("
 .D DIK^ACRFDIC
 K ^ACRUAL("LVL",ACRDUZ)
 W !,"ARMS DEPARTMENT ACCOUNT access being deleted."
 I $D(^ACRPA("B",ACRDUZ)) D
 .S DA=$O(^ACRPA("B",ACRDUZ,0))
 .S DIK="^ACRPA("
 .D DIK^ACRFDIC:DA
 S ACRDA(1)=0
 F  S ACRDA(1)=$O(^ACRLOCB("SEC",ACRDUZ,ACRDA(1))) Q:'ACRDA(1)  D
 .S ACRDA=0
 .F  S ACRDA=$O(^ACRLOCB("SEC",ACRDUZ,ACRDA(1),ACRDA)) Q:'ACRDA  D
 ..S DA(1)=ACRDA(1)
 ..S DA=ACRDA
 ..S DIK="^ACRLOCB("_DA(1)_",""SC"","
 ..D DIK^ACRFDIC
 F ACRXREF="CALLER","SSTAFF" D
 .S ACRDA(1)=0
 .F  S ACRDA(1)=$O(^ACRDOC(ACRXREF,ACRDUZ,ACRDA(1))) Q:'ACRDA(1)  D
 ..S ACRDA=0
 ..F  S ACRDA=$O(^ACRDOC(ACRXREF,ACRDUZ,ACRDA(1),ACRDA)) Q:'ACRDA  D
 ...S DA(1)=ACRDA(1)
 ...S DA=ACRDA
 ...S DIK="^ACRDOC("_DA(1)_",31,"
 ...D DIK^ACRFDIC
 W !!,"Withdrawal of ALL ARMS access has been completed."
 D PAUSE^ACRFWARN
 Q
BPA ;EP;TO ASSIGN MULTIPLE BPA'S TO A USER
 N ACRJ,ACRDOCDA,ACRDOC0,ACRY,ACRX,ACRYY,ACRVDA
 S ACRDOCDA=0
 F  S ACRDOCDA=$O(^ACRDOC("T",ACRDOCDA)) Q:'ACRDOCDA!$D(ACRQUIT)!$D(ACROUT)  D
 .Q:'$P(^ACRDOC(ACRDOCDA,0),U,23)
 .I $P($G(^ACRDOC(ACRDOCDA,15)),U,11) Q:$P(^(15),U,11)<DT
 .S ACRDOC0=^ACRDOC(ACRDOCDA,0)
 .S ACRJ=$G(ACRJ)+1
 .D BPAH:ACRJ=1
 .S ACRJ(ACRJ)=ACRDOCDA
 .S ACRVDA=$P(^ACRDOC(ACRDOCDA,"PO"),U,5)
 .I ACRVDA S ACRVDA=$P($G(^AUTTVNDR(ACRVDA,0)),U)
 .E  S ACRVDA="NOT STATED"
 .W !,ACRJ
 .W ?5,$P(ACRDOC0,U)
 .W ?23,$P(ACRDOC0,U,2)
 .W ?37,ACRVDA
 .I $Y+4>IOSL D
 ..D PAUSE^ACRFWARN
 ..D BPAH
 Q:$D(ACROUT)
 I '$G(ACRJ) D  Q
 .W !!,"There are no active BPA's on file."
 .D PAUSE^ACRFWARN
 K ACRQUIT
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Assign which BPA's to this user"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!+Y<1
 S ACRYY=Y
 F ACRJ=1:1 S ACRX=$P(ACRYY,",",ACRJ) Q:ACRX=""  D BPA1
 Q
BPA1 ;ADD USER AS CALLER TO A BPA
 Q:'$D(ACRJ(ACRX))
 S (DA(1),ACRDOCDA)=ACRJ(ACRX)
 S X=ACRDUZ
 S DIC="^ACRDOC("_DA(1)_",6,"
 S DIC(0)="L"
 D FILE^ACRFDIC
 Q
BPAH ;HEADER FOR BPA LISTING
 W @IOF
 W !,"ACTIVE BLANKET PURCHASE AGREEMENTS"
 W !,"NO."
 W ?5,"REQUISITION NO."
 W ?23,"PO NUMBER"
 W ?37,"VENDOR/CONTRACTOR"
 W !,"---"
 W ?5,"---------------"
 W ?23,"------------"
 W ?37,"-----------------------------"
 Q