source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR421B.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1RMPR421B ;PHX/HNB,RVD -CREATE PURCHASE CARD TRANSACTION ;3/1/1996
2 ;;3.0;PROSTHETICS;**3,20,26**;Feb 09, 1996
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4FILE ;
5 D PR^RMPR421A G:$D(DTOUT) KILL^RMPR421
6 I %=-1 G ASK5^RMPR421A
7 ;W !?5,"Posting to 10-2319 ..."
8 S $P(^RMPR(664,RMPRA,0),U,14)=RMPR("STA")
9 S (R1,RMPRCT,RMPRQT,RMPRTO,RMPRI,RMPRR)=0
10 S RMPRSH=$S($P(^RMPR(664,RMPRA,0),U,10):$P(^(0),U,10),1:"")
11 F S R1=$O(^RMPR(664,RMPRA,1,R1)) Q:R1'>0 D
12 .S RB=^RMPR(664,RMPRA,1,R1,0)
13 .S RMPRCT=$P(RB,U,3)
14 .S RMPRQT=$P(RB,U,4)
15 .S RMPRR=$P(RB,U,8)
16 .S RMPRTO=RMPRTO+$J(RMPRCT*RMPRQT,0,2)
17 K RB
18POST S RMPRTO=$S($D(^RMPR(664,RMPRA,2)):RMPRTO-$J((RMPRTO*$P(^(2),U,6)/100),0,2),1:RMPRTO)
19 I '$D(RMPRTO) G KILL^RMPR421
20 S $P(^RMPR(664,RMPRA,4),U,3)=RMPRTO+RMPRSH
21 S RMPR442=$P(^RMPR(664,RMPRA,4),U,6)
22 I RMPR442="" G KILL^RMPR421
23 W !!,"Your Transaction will be REJECTED and DELETED if you",!
24 W "do not enter an Eletronic Signature!",!!
25 S X=1
26 D OBL^PRCH7B(.X,RMPRA,RMPR442,RMPRTO+RMPRSH)
27 I X="^" W !!,"Transaction REJECTED, you must sign!" G KILL^RMPR421
28 W !?5,"Posting to Patient 2319 ..."
29M W !?5,"Purchase Card Transaction has been assigned Number: ",$$STA^RMPRUTIL,"-"_$P(^RMPR(664,RMPRA,4),U,5)
30 ;rmprtn needed for lab
31 S RMPRTRN=$P(^RMPR(664,RMPRA,4),U,5)
32 ;
33 S RMPRV=$P(^RMPR(664,RMPRA,0),U,4)
34 ;type of form
35 S $P(^RMPR(664,RMPRA,2),U,4)="2421PC",RMPRPER=$P(^(2),U,6)/100
36 I $D(RMPRPSC) S $P(^RMPR(664,RMPRA,2),U,5)=RMPRPSC
37 S:$D(RMPRDELN) $P(^RMPR(664,RMPRA,3),U)=RMPRDELN
38 S DA=RMPRA,DIK="^RMPR(664," D IX1^DIK
39 ;get AMIS grouper number
40 L +^RMPR(669.9,RMPRSITE,0):999 I $T=0 S RMPRG=DT_99 G GGC
41 S RMPRG=$P(^RMPR(669.9,RMPRSITE,0),U,7),RMPRG=RMPRG-1,$P(^(0),U,7)=RMPRG L -^RMPR(669.9,RMPRSITE,0)
42GGC S RMPRWO=$P(^RMPR(664,RMPRA,0),U,15)
43 ;check for lab
44 I RMPRWO,$D(^RMPR(664.2,+RMPRWO,0)) D
45 .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
46 S B2=0
47 F S B2=$O(^RMPR(664,RMPRA,1,B2)) Q:B2'>0 D R19^RMPR421C
48 K RMPRDP G:RMPRSH="" NS
49 K DD,DO S X=DT,DIC="^RMPR(660,",DIC(0)="LZ" D FILE^DICN S (RMPR660,DA)=+Y
50 ;
51 S RMPRTRN=$P(^RMPR(664,RMPRA,4),U,5)
52 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
53 .I $D(^RMPR(664.2,RMPRWO,0)) S $P(^(0),U,6)=$P(^(0),U,6)+RMPRSH
54 S:$D(RMPRDELN) ^RMPR(660,RMPR660,3)=RMPRDELN S ^(1)=RMPRTRN
55 S DIK="^RMPR(660," D IX1^DIK S $P(^RMPR(664,RMPRA,0),U,12)=RMPR660 K RMPRDP
56NS ;check approval
57 ;
58 W !,?5,"Updated 10-2319"
59 Q:$D(RMPRDP) D ^RMPR4P21
60 G EXIT^RMPR421
Note: See TracBrowser for help on using the repository browser.