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

PRCHUSER.m

Go to the documentation of this file.
  1. PRCHUSER ;WISC/AKS-Add/Edit purchase card user ;9/12/00 22:52
  1. ;;5.1;IFCAP;**8,125,165**;Oct 20, 2000;Build 12
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. N DIC,DA,Y,DIE,DR,PRCF,%,PRCHORIG,PRCRI
  1. S PRCF("X")="S" D ^PRCFSITE Q:'$D(PRC("SITE")) Q:$G(X)="^"
  1. MORE S DIC="^PRC(440.5,",DIC(0)="AELQM",DLAYGO=440.5
  1. S DIC("S")="I $D(PRC(""SITE"")),$P($G(^PRC(440.5,+Y,2)),""^"",3)=PRC(""SITE"")"
  1. D ^DIC Q:Y'>0 S DA=+Y,PRCRI(440.5)=DA,PRCIEN=DA
  1. N SITECHK S SITECHK=$P($G(^PRC(440.5,DA,2)),U,3) I +SITECHK'=0,SITECHK'=PRC("SITE") W !!,"This card is not entered for this station." H 3 G MORE
  1. S DIE="^PRC(440.5,",DR="[PRCH PURCHASE CARD]" D ^DIE ;Q:$D(Y)
  1. D EDIT^PRC0B(.X,"440.5;^PRC(440.5,;"_PRCRI(440.5),"70////P;71////"_DT)
  1. K PRCHHLDR,PRCHAPP,PRCHALT,PRCHSING,PRCHMNTH
  1. I '$G(DA) G Q
  1. S DA(1)=DA S PRCHUSER=$P(^PRC(440.5,DA,0),U,8)
  1. I $G(PRCHUSER),$G(PRCHORIG),PRCHUSER'=PRCHORIG D
  1. . S DIK="^PRC(440.5,"_DA(1)_",1,",DA=PRCHORIG D ^DIK K Y,DIK
  1. I $G(PRCHUSER),'$D(^PRC(440.5,DA,1,PRCHUSER)) D
  1. . I '$G(^PRC(440.5,DA(1),1,0)) D
  1. . . S $P(^PRC(440.5,DA(1),1,0),U,2)=$P(^DD(440.5,12,0),U,2)
  1. . S DIE="^PRC(440.5,"_DA(1)_",1,",DA=PRCHUSER,DR=".01////^S X=PRCHUSER"
  1. . D ^DIE
  1. . S $P(^PRC(440.5,DA(1),1,0),U,3)=DA,$P(^(0),U,4)=$P(^(0),U,4)+1
  1. . K DIE,DR,PRCHUSER
  1. ;PRC*5.1*165 Text added to inform user that surrogates lookup/add will only
  1. ; show those having access to FCP linked to PCard.
  1. W !!,?25,"*** ATTENTION ***"
  1. W !,?5,"Adding a new surrogate will now check surrogate name entered"
  1. W !,?5,"for valid access to the Fund Control Point linked to the PCard."
  1. W !,?5,"It will be possible to enter a name search and not find any"
  1. W !,?5,"due to an invalid name entry or user name with no access to"
  1. W !,?5,"Purchase Card FCP.",!
  1. MORES S:'$D(DA(1)) DA(1)=DA S DIC="^PRC(440.5,"_DA(1)_",1,",DIC(0)="AELQ"
  1. S DIC("S")="I +Y'=$P(^PRC(440.5,DA(1),0),U,8)" D ^DIC
  1. G:$D(DUOUT)!$D(DTOUT) Q G REPL:Y'>0 S DA=+Y
  1. I $P(Y,U,3)'=1 D
  1. . W !!?5,"Would you like to delete this surrogate user" S %=2 D YN^DICN
  1. . Q:%<1!(%=2)
  1. . S DA=+Y,DIK="^PRC(440.5,"_DA(1)_",1,"
  1. . D ^DIK K Y,DIK
  1. G MORES
  1. REPL ;REPLACEMENT CARD ENTRY
  1. D NOW^%DTC S XNOW=X
  1. K DIR
  1. S PRCRPLO=$P($G(^PRC(440.5,PRCIEN,50)),U)
  1. REPL1 S DIR("A")="REPLACED CARD: " S:PRCRPLO'="" DIR("B")=PRCRPLO S DIR("?")="Enter a valid card number for replaced card, 16 digits",DIR(0)="FAO^16:16"
  1. D ^DIR G Q:$D(DIRUT)!$D(DTOUT) S PRCRPLN=X K DIR
  1. I PRCRPLN'?1.N W " Must be 16 digits!!" G REPL1
  1. I PRCRPLO=PRCRPLN!'PRCRPLN G Q
  1. S PRCRIENN=$O(^PRC(440.5,"B",PRCRPLN,0)) I 'PRCRIENN W " Not a valid Purchase Card number" G REPL
  1. I $P(^PRC(440.5,PRCRIENN,2),U,2)'="Y" W " Replaced Card Must be INACTIVE" G REPL
  1. S PRCIENP=$O(^PRC(440.5,"ARPC",PRCRPLN,0)) I PRCIENP W " Replaced Card already listed under card: ",$P(^PRC(440.5,PRCIENP,0),U) G REPL
  1. S ERR="" D I ERR'="" W !," >> Replaced card does not match this card for: ",ERR G REPL
  1. . S PRCUR0=^PRC(440.5,PRCIEN,0),PRCUR2=^PRC(440.5,PRCIEN,2),PRCRPL0=$G(^PRC(440.5,PRCRIENN,0)),PRCRPL2=$G(^PRC(440.5,PRCRIENN,2))
  1. . I $P(PRCUR0,U,8)'=$P(PRCRPL0,U,8) S ERR="CARD HOLDER"
  1. . I $P(PRCUR0,U,2)'=$P(PRCRPL0,U,2) S:ERR'="" ERR=ERR_"," S ERR=ERR_"FUND CONTROL POINT"
  1. . I $P(PRCUR0,U,3)'=$P(PRCRPL0,U,3) S:ERR'="" ERR=ERR_"," S ERR=ERR_"COST CENTER"
  1. . I $P(PRCUR0,U,4)'=$P(PRCRPL0,U,4) S:ERR'="" ERR=ERR_"," S ERR=ERR_"BUDGET OBJECT CODE"
  1. . I $P(PRCUR2,U,3)'=$P(PRCRPL2,U,3) S:ERR'="" ERR=ERR_"," S ERR=ERR_"STATION NUMBER"
  1. K DIE S DIE="^PRC(440.5,",DA=PRCIEN,DR="51///^S X=PRCRPLN" D ^DIE K DIE,DA,DR
  1. Q W !!?5,"Would you like to register another purchase card" S %=2 D YN^DICN
  1. W ! G:%=1 MORE I %=0 W !!,"Please answer 'Yes' or 'No'"
  1. K DLAYGO,DA,PRCRPLO,DIR,PRCRPLN,PRCIEN,PRCRIENN,PRCIENP,ERR,PRCUR0,PRCUR2,PRCRPL0,PRCRPL2,XNOW,DIRUT,DTOUT,DIK,DUOUT,DIROUT
  1. QUIT
  1. INPUT1 ;Input transform for File #440.5, Field #1
  1. S DIC="^PRC(420,PRC(""SITE""),1,",DIC(0)="QEMNZ" S DIC("S")="I $D(^PRC(420,""C"",PRCHHLDR,PRC(""SITE""),+Y))",D="B^C" D MIX^DIC1 K:Y<0 X K DIC,D
  1. Q:'$D(X) S X=$P(Y(0),U)
  1. Q