86 lines
3.7 KiB
Mathematica
86 lines
3.7 KiB
Mathematica
RMPR421 ;PHX/HNB,RVD -CREATE PURCHASE CARD TRANSACTION, POST TO 2319 ;3/1/1996
|
|
;;3.0;PROSTHETICS;**3,20,26,50,58**;Feb 09, 1996
|
|
;Per VHA Directive 10-94-142, this routine should not be modified.
|
|
;
|
|
; ODJ - Patch 50 - 7/6/00 - NOIS NWI-0500-42828
|
|
; prompt for site if multi-divisional
|
|
;RVD - Patch 58 - 7/10/01 -add a page break when transaction is
|
|
; deleted
|
|
;
|
|
I '$D(^PRC(440.5,"H",DUZ)),'$D(^PRC(440.5,"C",DUZ)) W !!,"You are not an authorized Purchase Card User, CONTACT FISCAL!" Q
|
|
D DIV4^RMPRSIT Q:$D(X)
|
|
I '$D(^RMPR(669.9,RMPRSITE,4)) W !!,"The IFCAP SITE has not been defined to Prosthetics yet!" Q
|
|
EN1 D GETPAT^RMPRUTIL
|
|
G:'$D(RMPRDFN) EXT
|
|
K DIC,DINUM,DIC("DR")
|
|
S X=DT,DIC("DR")="1////^S X=RMPRDFN"
|
|
S DIC="^RMPR(664,",DIC(0)="AELQM",DLAYGO=664
|
|
K DD,DO D FILE^DICN K DLAYGO,DIC Q:Y<0
|
|
2529 ;called from RMPR29P init from lab
|
|
S (RMPRK,RMPRA)=+Y
|
|
S $P(^RMPR(664,RMPRA,2),U,4)="2421PC"
|
|
S DFN=RMPRDFN D DEM^VADPT
|
|
VIEW ;VIEW 10-2319
|
|
;
|
|
S RMPRBAC1=1 D ^RMPRPAT K RMPRBAC1 G:$D(RMPRKILL) KILL
|
|
;
|
|
;assign transaction number
|
|
;S $P(^RMPR(664,RMPRA,4),U,5)="PC"_RMPRA
|
|
S DIE="^RMPR(664,",DA=RMPRA
|
|
G P24^RMPR421A
|
|
;end this section
|
|
;
|
|
CHK D CHK1
|
|
I 'FL W !!,$C(7),?5,"REQUIRED FIELDS DO NOT EXIST ON THIS FORM",! G KILL
|
|
S $P(^RMPR(664,RMPRA,0),U,9)=DUZ
|
|
I $D(DTOUT)!($D(Y(0))) W !,$C(7),$C(7),"Please Try Later!" G KILL
|
|
ASK ;POST TRANSACTION QUESTION
|
|
S %=2 W !!,"Are you ready to POST to 10-2319 NOW"
|
|
D YN^DICN G:%=1 FILE^RMPR421B G:$D(DTOUT) KILL
|
|
I %=0 W !,"This will Create an Entry on the Prosthetic 10-2319 Record." G ASK
|
|
DEL ;
|
|
I %=-1 S %=2 R !,"Do you want to Delete this Transaction" D YN^DICN I $D(DTOUT)!(%=1) S:$D(RMPRA) RMPRK=RMPRA G KILL
|
|
I %=0 W !!,"ENTER YES OR NO!!",$C(7) S %=-1 G DEL
|
|
D ^RMPR4LI I RMPRX]"" G ASK
|
|
L W !!!,"Enter Item to Edit: " R X:DTIME G:'$T KILL
|
|
G:X["^"!(X="") ASK I X["?" D ZDSP^RMPR421A G L
|
|
S DIC="^RMPR(664,"_RMPRA_",1,",DIC(0)="EQMZ" D ^DIC
|
|
I +Y'>0 K DA,Y G L
|
|
S DA=+Y,DA(1)=RMPRA,DIE=DIC
|
|
S DR=".01;17;1;14;8;9;I $P(^RMPR(664,DA(1),1,DA,0),U,10)=4 S Y=""@1"";3;2;4;7;S Y="""";@1;10;3;2;4;7"
|
|
S:RMPRDR["RMPREYE" DR=".01;8;9;I $P(^RMPR(664,DA(1),1,DA,0),U,10)=4 S Y=""@1"";1;3;2;4;7;S Y="""";@1;10;1;3;2;4;7" D ^DIE
|
|
D CHK
|
|
I '$D(FL) W !!,$C(7),?5,"REQUIRED FIELDS DO NOT EXIST ON THIS FORM",! G KILL
|
|
S DIE="^RMPR(664,",DA=RMPRA,DR=11 D ^DIE G L
|
|
;
|
|
CHK1 ;CHECK FOR EXISTENCE OF ITEMS ON PURCHASING FORMS
|
|
S FL=1
|
|
I $D(^RMPR(664,RMPRA,1)) S (FL,RI)=0 F S RI=$O(^RMPR(664,RMPRA,1,RI)) Q:RI'>0 Q:'$D(^(RI,0)) D
|
|
.S FL=1
|
|
.S RB=^RMPR(664,RMPRA,1,RI,0)
|
|
.I $P(RB,U,3)=""!($P(RB,U,4)="")!($P(RB,U,5)="")!($P(RB,U,9)="")!($P(RB,U,10)="") S FL=0 Q
|
|
Q
|
|
;
|
|
KILL ;DELETE PURCHASING ENTRY
|
|
Q:'$D(RMPRK)
|
|
S DA=RMPRK,DIK="^RMPR(664," D ^DIK W !,$C(7),?20,"Deleted..." K RMPRDOD,RMPROB
|
|
I $E(IOST)["C" W ! S DIR(0)="E" D ^DIR
|
|
I $D(RMPRWO),$D(^RMPR(664.2,+RMPRWO,0)) D K DIK
|
|
.S DA=0
|
|
.F S DA=$O(^RMPR(664.2,RMPRWO,1,"AC",RMPRA,DA)) Q:$G(DA)'>0
|
|
.S DIK="^RMPR(664.2,"_RMPRWO_",1,",DA(1)=RMPRWO
|
|
.D ^DIK
|
|
EXIT ;Common Exit Point
|
|
;ask for suspense entry to close
|
|
D:'$D(DTOUT) LINK^RMPRS
|
|
;clean-up from calls to vadpt
|
|
D KVAR^VADPT
|
|
N RMPR,RMPRSITE,RMPRMDIV D KILL^XUSCLEAN Q
|
|
;we should be able to call kernel at this point to clean-up the rest.
|
|
EXT ;K RMPRFLAG,RMPRG,RD,RMPRPSC,RMPRCONT,RMPRSH,RMPRDS,RMPRTO,RMPRCT,RMPRQT,R1,B2,D1,RMPRI,%,B1,DA,DIC,DIK,PRCS,PRCSCPAN,RMPRIN,RMPRPC,RMPRAMIS,RMPRARD,RMPRCNT,RMPRIT,RMPRIT1,RMPRU,SR,TYPE,RAC,FL,RMPRCTK,PRCSIP,PQTY,FL1,RMPRNOB,HY,RMPRGO
|
|
;K RMPRDIE,RMPRDR,RMPRDES,DIE,RMPRSR,DR,DTOUT,RMPRDOB,RMPRSC,RMPRTRN,RMPRX,RMPRK,RMPR660,RMPRA,RMPRDFN,RMPRDIS,RMPRIS,RMPRNAM,RMPRR,RMPRS,RMPRSSN
|
|
;K RMPRSSNE,RMPRT,RMPRTN,RMPRV,Y,LINE,RMPRUP,RMPRSR,RMPRPI,RI,RA,RMPRI1,RMPRDELN,RDP,Y,RMPRSER,NAME
|
|
I $D(RMPRWO),RMPRWO D POST^RMPR29U Q
|
|
I $D(RMPRDA) Q
|
|
K RMPROB,RMPRF,PRC,PRCS,RBL,RDA,RVA,RX,RMPRKILL Q
|