source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBAAV01.m@ 1806

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1FBAAV01 ;AISC/GRR-ELECTRONICALLY TRANSMIT FEE DATA CONTINUED ;11 Apr 2006 2:52 PM
2 ;;3.5;FEE BASIS;**89,98**,JAN 30, 1995;;Build 54
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4NEWMSG ;get new message number, reset line counter
5 ;FBLN=line counter, FBFEE=FEE message counter, FBNVP=NVP message counter
6 ;FBOKTX=1 if message pending, 0 otherwise
7 S FBXMZ=0,FBJ=$G(J),FBK=$G(K) S:'$D(FBFEE) FBFEE=1 S:'$D(FBNVP) FBNVP=1
8 S XMSUB=$S('$D(FBFLAG):"FEE BASIS MESSAGE # "_FBFEE,1:"FEE NON-VA HOSP TO PRICER MESSAGE # "_FBNVP),XMDUZ=DUZ
9 S FBOKTX=0
10 D XMZ^XMA2
11 I '$D(XMZ)!(XMZ'>0) G NEWMSG
12 S FBXMZ=XMZ,FBLN=0,FBOKTX=1,J=FBJ,K=FBK K XMZ
13 Q
14 ;
15XMIT ;send message, increment message counter
16 ;FBLN=line counter, FBFEE=FEE message counter, FBNVP=NVP message counter
17 ;FBXMFEE(=FEE recipient array, FBXMNVP(=NVP recipient array
18 S FBJ=J,FBK=K K XMY D ROUT
19 S XMZ=FBXMZ,^XMB(3.9,XMZ,2,0)="^3.92A^"_FBLN_"^"_FBLN_"^"_DT
20 S XMDUN=$P(^VA(200,DUZ,0),U) D ENT1^XMD
21 S FBLN=0,FBOKTX=0
22 D INCRM ;increment message counter
23 S J=FBJ,K=FBK
24 Q
25 ;
26ROUT ;set up recipients for message
27 I $D(FBFLAG) S FBI=0 F S FBI=$O(FBXMNVP(FBI)) Q:'FBI S X=FBXMNVP(FBI),XMN=0,XMDF="" D INST^XMA21 K XMN,XMDF
28 I '$D(FBFLAG) S FBI=0 F S FBI=$O(FBXMFEE(FBI)) Q:'FBI S X=FBXMFEE(FBI),XMN=0,XMDF="" D INST^XMA21 K XMN,XMDF
29 S XMY(DUZ)="",XMDUZ=DUZ Q
30 ;
31INCRM ;increment message counter
32 I $D(FBFLAG) S FBNVP=FBNVP+1
33 E S FBFEE=FBFEE+1
34 Q
35 ;
36INCRL ;increment line counter
37 S FBLN=FBLN+1 Q
38 ;
39STORE ;set message string
40 D INCRL S ^XMB(3.9,FBXMZ,2,FBLN,0)=FBSTR
41 Q
42 ;
43ADDRESS ;set up recipient array, FBXMFEE( for FEE router, FBXMNVP( for NVP router
44 F VATNAME="FEE","NVP" D ^VATRAN G:VATERR ADDQ S FBI=0 F S FBI=$O(VAT(FBI)) Q:'FBI S FBVAR="FBXM"_VATNAME_"("_FBI_")" S @FBVAR=VAT(FBI)
45ADDQ Q
46 ;Following checks for Austin Name Field in Vendor file in order to continue transmitting that batch.
47CKB3V F FB1=0:0 S FB1=$O(^FBAAC("AC",J,FB1)) Q:'FB1!($G(FBERR)) F FB2=0:0 S FB2=$O(^FBAAC("AC",J,FB1,FB2)) Q:FB2'>0!($G(FBERR)) D CHKV
48 Q
49CKB5V F FB1=0:0 S FB1=$O(^FBAA(162.1,"AE",J,FB1)) Q:'FB1!($G(FBERR)) I $G(^FBAA(162.1,FB1,0)) S FB2=+$P(^(0),"^",4) D CHKV
50 Q
51CKB9V F FB1=0:0 S FB1=$O(^FBAAI("AC",J,FB1)) Q:'FB1!($G(FBERR)) I $G(^FBAAI(FB1,0)) S FB2=+$P(^(0),"^",3) D CHKV
52 Q
53CHKV I $$CKVEN^FBAADV(FB2) W !!,*7,"VENDOR: ",$$VNAME^FBNHEXP(FB2)," Not approved in Austin yet.",!,"Batch # ",FBAABN," CANNOT BE TRANSMITTED!!!" S FBERR=1
54 Q
55 ;
56STRING ;called from FBAAV0 to build 'B3' payment record
57 ;
58 S FBPICN=$$PADZ(FBPICN,30)
59 ;
60 ; build and store 1st line in message
61 S FBSTR=3_FBAASN_FBSSN_FBPAYT_FBPNAMX_FBVID_" "_FBAP_FBAAON_FBSUSP_FBPOV_FBPATT_FBTD_FBTT_FBDIN_FBINVN_FBST_FBCTY_FBZIP_$E(FBPSA,1,3)_FBCPT_FBPOS_FBHCFA_FBVTOS_FBPD
62 S FBSTR=FBSTR_+$P($G(FBY),U,2)_$E(PAD,1,8)_FBPICN_$S(+FBY:$$AUSDT^FBAAV3(+FBY),1:FBDIN)
63 S FBSTR=FBSTR_FBADMIT_FBDOB_FBUNITS_FBAUTHF_FBMOD1_FBMOD2_FBMOD3_FBMOD4_FBADJR1_FBADJR2_"~"
64 D STORE
65 ;
66 ; build and store 2nd line in message
67 S FBSTR=FBADJA1_FBADJA2_FBNPI_"~$"
68 D STORE
69 ;
70 K FBPICN,FBY
71 Q
72 ;
73PADZ(X,Y) ;call to pad 'X' with leading zeros' to a field length of 'Y'
74 ;
75 I $S('$L(X):1,'Y:1,Y<$L(X):1,1:0) Q ""
76 N Z S Z=0,$P(Z,0,Y)=0
77 Q $E(Z,$L(X)+1,Y)_X
Note: See TracBrowser for help on using the repository browser.