VistA-FOIAVistA/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR421B.m

61 lines
2.6 KiB
Mathematica

RMPR421B ;PHX/HNB,RVD -CREATE PURCHASE CARD TRANSACTION ;3/1/1996
;;3.0;PROSTHETICS;**3,20,26**;Feb 09, 1996
;Per VHA Directive 10-93-142, this routine should not be modified.
FILE ;
D PR^RMPR421A G:$D(DTOUT) KILL^RMPR421
I %=-1 G ASK5^RMPR421A
;W !?5,"Posting to 10-2319 ..."
S $P(^RMPR(664,RMPRA,0),U,14)=RMPR("STA")
S (R1,RMPRCT,RMPRQT,RMPRTO,RMPRI,RMPRR)=0
S RMPRSH=$S($P(^RMPR(664,RMPRA,0),U,10):$P(^(0),U,10),1:"")
F S R1=$O(^RMPR(664,RMPRA,1,R1)) Q:R1'>0 D
.S RB=^RMPR(664,RMPRA,1,R1,0)
.S RMPRCT=$P(RB,U,3)
.S RMPRQT=$P(RB,U,4)
.S RMPRR=$P(RB,U,8)
.S RMPRTO=RMPRTO+$J(RMPRCT*RMPRQT,0,2)
K RB
POST S RMPRTO=$S($D(^RMPR(664,RMPRA,2)):RMPRTO-$J((RMPRTO*$P(^(2),U,6)/100),0,2),1:RMPRTO)
I '$D(RMPRTO) G KILL^RMPR421
S $P(^RMPR(664,RMPRA,4),U,3)=RMPRTO+RMPRSH
S RMPR442=$P(^RMPR(664,RMPRA,4),U,6)
I RMPR442="" G KILL^RMPR421
W !!,"Your Transaction will be REJECTED and DELETED if you",!
W "do not enter an Eletronic Signature!",!!
S X=1
D OBL^PRCH7B(.X,RMPRA,RMPR442,RMPRTO+RMPRSH)
I X="^" W !!,"Transaction REJECTED, you must sign!" G KILL^RMPR421
W !?5,"Posting to Patient 2319 ..."
M W !?5,"Purchase Card Transaction has been assigned Number: ",$$STA^RMPRUTIL,"-"_$P(^RMPR(664,RMPRA,4),U,5)
;rmprtn needed for lab
S RMPRTRN=$P(^RMPR(664,RMPRA,4),U,5)
;
S RMPRV=$P(^RMPR(664,RMPRA,0),U,4)
;type of form
S $P(^RMPR(664,RMPRA,2),U,4)="2421PC",RMPRPER=$P(^(2),U,6)/100
I $D(RMPRPSC) S $P(^RMPR(664,RMPRA,2),U,5)=RMPRPSC
S:$D(RMPRDELN) $P(^RMPR(664,RMPRA,3),U)=RMPRDELN
S DA=RMPRA,DIK="^RMPR(664," D IX1^DIK
;get AMIS grouper number
L +^RMPR(669.9,RMPRSITE,0):999 I $T=0 S RMPRG=DT_99 G GGC
S RMPRG=$P(^RMPR(669.9,RMPRSITE,0),U,7),RMPRG=RMPRG-1,$P(^(0),U,7)=RMPRG L -^RMPR(669.9,RMPRSITE,0)
GGC S RMPRWO=$P(^RMPR(664,RMPRA,0),U,15)
;check for lab
I RMPRWO,$D(^RMPR(664.2,+RMPRWO,0)) D
.F DA=0:0 S DA=$O(^RMPR(664.2,RMPRWO,1,"AC",RMPRA,DA)) Q:DA'>0 S DIK="^RMPR(664.2,"_RMPRWO_",1,",DA(1)=RMPRWO D ^DIK
S B2=0
F S B2=$O(^RMPR(664,RMPRA,1,B2)) Q:B2'>0 D R19^RMPR421C
K RMPRDP G:RMPRSH="" NS
K DD,DO S X=DT,DIC="^RMPR(660,",DIC(0)="LZ" D FILE^DICN S (RMPR660,DA)=+Y
;
S RMPRTRN=$P(^RMPR(664,RMPRA,4),U,5)
S ^RMPR(660,RMPR660,0)=DT_U_RMPRDFN_U_DT_"^X^^^^^"_RMPRV_U_RMPR("STA")_"^^^"_14_U_RMPRS_"^^"_RMPRSH_"^"_RMPRSH_"^^^^^",^("AMS")=RMPRG,^("AM")=U_U_RMPRDIS_U_RMPRSC,$P(^(0),U,27)=DUZ I $D(RMPRWO),RMPRWO S $P(^("AM"),U,2)=1 D
.I $D(^RMPR(664.2,RMPRWO,0)) S $P(^(0),U,6)=$P(^(0),U,6)+RMPRSH
S:$D(RMPRDELN) ^RMPR(660,RMPR660,3)=RMPRDELN S ^(1)=RMPRTRN
S DIK="^RMPR(660," D IX1^DIK S $P(^RMPR(664,RMPRA,0),U,12)=RMPR660 K RMPRDP
NS ;check approval
;
W !,?5,"Updated 10-2319"
Q:$D(RMPRDP) D ^RMPR4P21
G EXIT^RMPR421