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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPR421B 2732 printed Dec 13, 2024@02:32:38 Page 2
RMPR421B ;PHX/HNB,RVD -CREATE PURCHASE CARD TRANSACTION ;3/1/1996
+1 ;;3.0;PROSTHETICS;**3,20,26**;Feb 09, 1996
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
FILE ;
+1 DO PR^RMPR421A
if $DATA(DTOUT)
GOTO KILL^RMPR421
+2 IF %=-1
GOTO ASK5^RMPR421A
+3 ;W !?5,"Posting to 10-2319 ..."
+4 SET $PIECE(^RMPR(664,RMPRA,0),U,14)=RMPR("STA")
+5 SET (R1,RMPRCT,RMPRQT,RMPRTO,RMPRI,RMPRR)=0
+6 SET RMPRSH=$SELECT($PIECE(^RMPR(664,RMPRA,0),U,10):$PIECE(^(0),U,10),1:"")
+7 FOR
SET R1=$ORDER(^RMPR(664,RMPRA,1,R1))
if R1'>0
QUIT
Begin DoDot:1
+8 SET RB=^RMPR(664,RMPRA,1,R1,0)
+9 SET RMPRCT=$PIECE(RB,U,3)
+10 SET RMPRQT=$PIECE(RB,U,4)
+11 SET RMPRR=$PIECE(RB,U,8)
+12 SET RMPRTO=RMPRTO+$JUSTIFY(RMPRCT*RMPRQT,0,2)
End DoDot:1
+13 KILL RB
POST SET RMPRTO=$SELECT($DATA(^RMPR(664,RMPRA,2)):RMPRTO-$JUSTIFY((RMPRTO*$PIECE(^(2),U,6)/100),0,2),1:RMPRTO)
+1 IF '$DATA(RMPRTO)
GOTO KILL^RMPR421
+2 SET $PIECE(^RMPR(664,RMPRA,4),U,3)=RMPRTO+RMPRSH
+3 SET RMPR442=$PIECE(^RMPR(664,RMPRA,4),U,6)
+4 IF RMPR442=""
GOTO KILL^RMPR421
+5 WRITE !!,"Your Transaction will be REJECTED and DELETED if you",!
+6 WRITE "do not enter an Eletronic Signature!",!!
+7 SET X=1
+8 DO OBL^PRCH7B(.X,RMPRA,RMPR442,RMPRTO+RMPRSH)
+9 IF X="^"
WRITE !!,"Transaction REJECTED, you must sign!"
GOTO KILL^RMPR421
+10 WRITE !?5,"Posting to Patient 2319 ..."
M WRITE !?5,"Purchase Card Transaction has been assigned Number: ",$$STA^RMPRUTIL,"-"_$PIECE(^RMPR(664,RMPRA,4),U,5)
+1 ;rmprtn needed for lab
+2 SET RMPRTRN=$PIECE(^RMPR(664,RMPRA,4),U,5)
+3 ;
+4 SET RMPRV=$PIECE(^RMPR(664,RMPRA,0),U,4)
+5 ;type of form
+6 SET $PIECE(^RMPR(664,RMPRA,2),U,4)="2421PC"
SET RMPRPER=$PIECE(^(2),U,6)/100
+7 IF $DATA(RMPRPSC)
SET $PIECE(^RMPR(664,RMPRA,2),U,5)=RMPRPSC
+8 if $DATA(RMPRDELN)
SET $PIECE(^RMPR(664,RMPRA,3),U)=RMPRDELN
+9 SET DA=RMPRA
SET DIK="^RMPR(664,"
DO IX1^DIK
+10 ;get AMIS grouper number
+11 LOCK +^RMPR(669.9,RMPRSITE,0):999
IF $TEST=0
SET RMPRG=DT_99
GOTO GGC
+12 SET RMPRG=$PIECE(^RMPR(669.9,RMPRSITE,0),U,7)
SET RMPRG=RMPRG-1
SET $PIECE(^(0),U,7)=RMPRG
LOCK -^RMPR(669.9,RMPRSITE,0)
GGC SET RMPRWO=$PIECE(^RMPR(664,RMPRA,0),U,15)
+1 ;check for lab
+2 IF RMPRWO
IF $DATA(^RMPR(664.2,+RMPRWO,0))
Begin DoDot:1
+3 FOR DA=0:0
SET DA=$ORDER(^RMPR(664.2,RMPRWO,1,"AC",RMPRA,DA))
if DA'>0
QUIT
SET DIK="^RMPR(664.2,"_RMPRWO_",1,"
SET DA(1)=RMPRWO
DO ^DIK
End DoDot:1
+4 SET B2=0
+5 FOR
SET B2=$ORDER(^RMPR(664,RMPRA,1,B2))
if B2'>0
QUIT
DO R19^RMPR421C
+6 KILL RMPRDP
if RMPRSH=""
GOTO NS
+7 KILL DD,DO
SET X=DT
SET DIC="^RMPR(660,"
SET DIC(0)="LZ"
DO FILE^DICN
SET (RMPR660,DA)=+Y
+8 ;
+9 SET RMPRTRN=$PIECE(^RMPR(664,RMPRA,4),U,5)
+10 SET ^RMPR(660,RMPR660,0)=DT_U_RMPRDFN_U_DT_"^X^^^^^"_RMPRV_U_RMPR("STA")_"^^^"_14_U_RMPRS_"^^"_RMPRSH_"^"_RMPRSH_"^^^^^"
SET ^("AMS")=RMPRG
SET ^("AM")=U_U_RMPRDIS_U_RMPRSC
SET $PIECE(^(0),U,27)=DUZ
IF $DATA(RMPRWO)
IF RMPRWO
SET $PIECE(^("AM"),U,2)=1
Begin DoDot:1
+11 IF $DATA(^RMPR(664.2,RMPRWO,0))
SET $PIECE(^(0),U,6)=$PIECE(^(0),U,6)+RMPRSH
End DoDot:1
+12 if $DATA(RMPRDELN)
SET ^RMPR(660,RMPR660,3)=RMPRDELN
SET ^(1)=RMPRTRN
+13 SET DIK="^RMPR(660,"
DO IX1^DIK
SET $PIECE(^RMPR(664,RMPRA,0),U,12)=RMPR660
KILL RMPRDP
NS ;check approval
+1 ;
+2 WRITE !,?5,"Updated 10-2319"
+3 if $DATA(RMPRDP)
QUIT
DO ^RMPR4P21
+4 GOTO EXIT^RMPR421