source: FOIAVistA/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCAFBDM.m@ 1676

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

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1PRCAFBDM ;WASH-ISC@ALTOONA,PA/CLH-Build MODIFIED FMS Billing Document ;9/16/94 12:11 PM
2 ;;4.5;Accounts Receivable;**60,90,204,203,220**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4EN(BILL,AMT,ADJTYP,PRCADJD,TN,ERR) ;Process NEW BILL to FMS
5 Q:$D(RCONVERT)
6 N GECSFMS,REC,FMSNUM
7 K ^TMP("PRCABD",$J)
8 I $G(BILL)="" S ERR="1^Missing Bill Number" Q
9 ;
10 ; funds 5014 (old), 2431 (old), 528701,03,04,09 and 4032 should not create a BD
11 S %=$P($G(^PRCA(430,BILL,11)),"^",17)
12 I %=5014!(%=2431)!(%=4032) Q
13 I %[5287 Q:$$PTACCT^PRCAACC(%)
14 ;
15 I +PRCADJD<1 S PRCADJD=DT
16 I AMT<0 S AMT=-AMT
17 I '$D(^PRCA(430,BILL,0)) S ERR="1^Unable to locate bill" Q
18 S REC=$G(^PRCA(430,BILL,0)),FMSNUM=$P($P(REC,U),"-")_$P($P(REC,U),"-",2)
19 W !!,"Creating FMS Modified Billing Document..."
20 N FMSDT S FMSDT=$$FMSDATE^RCBEUTRA(DT)
21 S ^TMP("PRCABD",$J,1)="BD2^"_$E(FMSDT,4,5)_U_$E(FMSDT,6,7)_U_$E(FMSDT,2,3)_"^^^^^^M^^^"_$J(AMT,0,2)_"^~"
22 S ^TMP("PRCABD",$J,2)="LIN^~"
23 S ^TMP("PRCABD",$J,3)="BDA^"_$$LINE^RCXFMSC1(BILL)_"^^^^^^^^^^^^^^"_$J(AMT,0,2)_"^"_$S(ADJTYP=35:"D",ADJTYP=1:"I",1:"")_"^AR_INTERFACE^~"
24 ;build control segment
25 D CONTROL^GECSUFMS("A",$P(REC,U,12),FMSNUM,"BD",10,"1","","Modified Billing Document")
26 S FMSNUM1=$P($G(GECSFMS("DOC")),U,3)_"-"_$P($G(GECSFMS("DOC")),U,4)_"-"_$P($G(GECSFMS("BAT")),U,3)
27 D OPEN^RCFMDRV1(FMSNUM1,7,"T"_TN,.ENT,.ERR,BILL,TN) I ERR]"" W !!,"Unable to create entry in AR Document File.",! S ERR=-1
28 ;build and send document to FTH
29 S DA=0 F S DA=$O(^TMP("PRCABD",$J,DA)) Q:'DA D SETCS^GECSSTAA(GECSFMS("DA"),^(DA))
30 D SETCODE^GECSSDCT(GECSFMS("DA"),"D RETN^RCFMFN02")
31 D SETSTAT^GECSSTAA(GECSFMS("DA"),"Q")
32 D SSTAT^RCFMFN02("T"_TN,1)
33 W !,"Document #",GECSFMS("DA")," Created.",!
34 Q
35 ;
Note: See TracBrowser for help on using the repository browser.