source: FOIAVistA/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCARFD1.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: 5.8 KB
Line 
1PRCARFD1 ;WASH-ISC@ALTOONA,PA/LDB-APPROVE REFUND AND GENERATE FMS DOC ;2/14/96 9:13 AM
2 ;;4.5;Accounts Receivable;**21,36,90,104,141,190,204,203,207,220,238**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5APPRV ;Enter Elec sig for CFO
6 N ADD,DA,ENT,ERROR,PRCABN0,PRCANM,RA,TIME,X,Y
7 F X=1:1:5 S RA=+$G(RA)+$P($G(^PRCA(430,PRCABN,7)),U,X)
8 I +$G(RA)'=$P($G(^PRCA(430,PRCABN,7)),U,18) W !!,"REFUND AMOUNT OUT-OF-BALANCE!" Q
9 S DA=+PRCABN D SIG^PRCASIG I $G(PRCANM)']"" W !!,"DID NOT APPROVE REFUND" Q
10 L +^PRCA(430,PRCABN):1 Q:'$T S $P(^PRCA(430,PRCABN,9),U,2)=PRCANM,$P(^(9),U,1)=DUZ,$P(^(9),U,3)=$G(DT) L -^PRCA(430,PRCABN) W !," <APPROVED BY CERTIFYING OFFICER>"
11 I $G(^PRCA(430,PRCABN,7))'>0 W !!,*7,"This Accounts Receivable doesn't have an excess payment !" D CANC^PRCARFD(PRCABN) W !!,"Status Changed to 'CANCELLATION'",! Q
12 W *7,!!,"No other transactions may be made to the bill now."
13 ;
14FMSDOC ;Create FMS overcollection payment voucher document
15 ;
16 N %,ADD,GECSFMS,DATE,DEBT,DY,MO,PRCA,PRCANM,STAT,YR,DOC
17 I '$D(^PRCA(430,+$G(PRCABN),0)) W !,"THIS BILL NUMBER ENTRY IN FILE 430 IS CORRUPTED",!,"NO PROCESSING CAN CONTINUE - SEE IRM" Q
18 S PRCABN0=$G(^PRCA(430,+PRCABN,0)),PRCANM=$P(PRCABN0,"^")
19 S STAT=$$GSTAT^RCFMFN02(PRCANM)
20 I STAT>0&(STAT<3) W !!,*7,"THIS DOCUMENT SEEMS TO HAVE ALREADY BEEN SENT TO FMS-",!,"IT CANNOT BE RESENT UNLESS FMS REJECTS IT." Q
21FMS W !!,"Creating an FMS Overcollection Payment Voucher . . .",!
22 S PRCA("STN")=$P($P(PRCABN0,U),"-")
23 S DEBT=+$P(PRCABN0,U,9),DEBT=$P($G(^RCD(340,DEBT,0)),U)
24 S PRCA("VNAME")=$$NAM^RCFN01(DEBT) I PRCA("VNAME")="" S ADD=0
25 S PRCA("VNAME")=$P(PRCA("VNAME"),",",2)_" "_$P(PRCA("VNAME"),",")
26 S PRCA("VCODE")=$$SSN^RCFN01(DEBT)
27 S ADD=1
28 S PRCA("ADD")=$$DADD^RCAMADD(DEBT,1)
29 S PRCA("VADD1")=$P(PRCA("ADD"),U) I PRCA("VADD1")="" S ADD=0
30 S PRCA("VADD2")=$P(PRCA("ADD"),U,2)
31 S PRCA("VCITY")=$P(PRCA("ADD"),U,4) I PRCA("VCITY")="" S ADD=0
32 S PRCA("VSTATE")=$P(PRCA("ADD"),U,5) I PRCA("VSTATE")="" S ADD=0
33 S PRCA("VZIP")=$P(PRCA("ADD"),U,6) I PRCA("VZIP")="" S ADD=0
34 S PRCA("LAMT")=$P($G(^PRCA(430,+PRCABN,7)),U,18)
35 S PRCANM=$P($G(^PRCA(430,+PRCABN,0)),U)
36 I 'ADD D Q
37 .W *7,!,"THIS PATIENT DOES NOT HAVE A VALID ADDRESS."
38 .W !,"AN FMS DOCUMENT CANNOT BE CREATED WITHOUT A VALID ADDRESS."
39 .Q
40 I '$G(REFMS)&(DT>$$LDATE^RCRJR(DT)) S Y=$E($$FPS^RCAMFN01(DT,1),1,5)_"01" D DD^%DT W !!," * * * * Transmission will be held until "_Y_" * * * *",!
41 D NOW^%DTC S YR=$E(%,2,3),MO=$E(%,4,5),DY=$E(%,6,7)
42 S Y=$P(%,".") X ^DD("DD") S DATE=$P(Y,",",2)_MO_DY
43 S TIME=$P(%,".",2)
44 S PRCA("FY")=$$FY^RCFN01($P(%,"."))
45 S PRCA("LAMT")=$J(PRCA("LAMT"),0,2)
46 D CONTROL^GECSUFMS("A",PRCA("STN"),PRCANM,"OP",10,0,"","")
47 ;S FMSTRING("CTL")="CTL^FMS^"_PRCA("STN")^DOC^OP^10^^"_PRCA("STN")_PRCA("FY")_SEQ_U_YYYYMMDD_U_TIME_U_SEQ_U_PRCANM_"^ARS"_PRCA("STN")_U_VER
48 I '$D(GECSFMS("DA")) W !,"AN ENTRY WAS NOT MADE IN THE STACKER FILE.",!,"PLEASE RE-SELECT THE BILL IN THE APPROVE OPTION." Q
49 S DOC=$S($G(GECSFMS("DOC"))]"":$P(GECSFMS("DOC"),"^",3)_"-"_$P(GECSFMS("DOC"),"^",4),1:PRCANM)
50 D OPEN^RCFMDRV1(DOC,5,"B"_PRCABN,.ENT,.ERROR,PRCABN)
51 I ERROR]"" W !!,*7,"AN AR DOC REF CANNOT BE CREATED BECAUSE THE FOLLOWING ERROR HAS OCCURRED -",!?10,ERROR,!
52 N FMSDT S FMSDT=$$FMSDATE^RCBEUTRA(DT)
53 S ^TMP($J,"PRCA",1)="PV2^"_$E(FMSDT,4,5)_U_$E(FMSDT,6,7)_U_$E(FMSDT,2,3)_"^^^^^E^01^^^^^^^^^^MISCVET^^"_PRCA("LAMT")_"^"
54 S ^TMP($J,"PRCA",2)=PRCA("VNAME")_U_$E(PRCA("VADD1"),1,30)_U_$E(PRCA("VADD2"),1,30)_U_PRCA("VCITY")_U_PRCA("VSTATE")_U_PRCA("VZIP")_"^~"
55 D
56 . N PRCAPT
57 . S PRCAPT=$S(DT<3030926:5287,$G(REFMS)&(DT<3031001):5287,DT'<3030926&(DT<$$ADDPTEDT^PRCAACC()):5287.3,1:528703)
58 .S:$E(PRCAPT,1,4)=5287 PRCA("FY")="05" ; FY
59 .S ^TMP($J,"PRCA",3)="LIN^~PVA^001^^^^^^^^^^^"_PRCA("FY")_"^^"_PRCAPT_"^"_PRCA("STN")_"^^^^^^^^^^^"_$$CALCRSC^RCXFMSUR(+PRCABN)_"^^^^^^"_PRCA("LAMT")_"^I^~"
60 .;S ^TMP($J,"PRCA",3)="LIN^~PVA^001^^^^^^^^^^^"_PRCA("FY")_"^^"_$S(DT<3030926:5287,$G(REFMS)&(DT<3031001):5287,1:528703)_"^"_PRCA("STN")_"^^^^^^^^^^^"_$$CALCRSC^RCXFMSUR(+PRCABN)_"^^^^^^"_PRCA("LAMT")_"^I^~"
61 S DA=0 F S DA=$O(^TMP($J,"PRCA",DA)) Q:'DA D
62 .D SETCS^GECSSTAA(GECSFMS("DA"),^TMP($J,"PRCA",DA))
63 D SETCODE^GECSSDCT(GECSFMS("DA"),"D RETN^RCFMFN02")
64 D SETSTAT^GECSSTAA(GECSFMS("DA"),"Q")
65 D SSTAT^RCFMFN02("B"_+$G(PRCABN),1)
66 Q:$P($G(^PRCA(430,+$G(PRCABN),0)),U,8)=$O(^PRCA(430.3,"AC",41,0))
67 K ^TMP($J)
68 ;Pass to FMS
69 ;Call generic interface to setup document if completed flag proceed
70 ;change date if resent to FMS
71 ;
72TREF ;Create REFUNDED transaction and set to REFUNDED status
73 N DIE,DR,DA,PRCASVC,PRCAA2,PRCAEN,PRCAMT,X,Y,DIR,DEBTOR,CLYRRF
74 S U="^"
75 I $P($G(^PRCA(430,+PRCABN,0)),U,8)=$O(^PRCA(430.3,"AC",120,0)) Q
76 D SETTR^PRCAUTL I '$G(PRCAEN) W !!,"COULD NOT SET UP A REFUND TRANSACTION!" Q
77 W !!,"Creating a REFUNDED transaction for bill number: ",$P(^PRCA(430,PRCABN,0),"^")," . . .",!
78 D PATTR^PRCAUTL S PRCA("ADJ")=$O(^PRCA(430.3,"AC",120,0)),PRCASV("BDT")=$G(DT),PRCASV("APR")=DUZ,PRCASV("FY")="^"_+$P($G(^PRCA(430,PRCABN,7)),U,18)
79 S DIE="^PRCA(433,",DR="[PRCA FY ADJ2 BATCH]",DA=PRCAEN D ^DIE
80 S PRCAMT=-$G(PRCAMT),PRCAA2=$P(^PRCA(433,PRCAEN,4,0),U,3)
81 D UPFY^PRCADJ,TRANUP^PRCAUTL
82 S $P(^PRCA(430,PRCABN,7),U,1)=$G(^PRCA(430,PRCABN,7))+PRCAMT,PRCA("STATUS")=$O(^PRCA(430.3,"AC",120,0)) D UPSTATS^PRCAUT2
83 W !,"Bill is now in REFUNDED status.",!
84 ;CHECK TO SEE IF TOP REFUND AND SET UP FIELDS TO SEND WITH NEXT
85 ;TOP TRANSMISSION
86 S DIR(0)="Y",DIR("B")="NO",DIR("A")="Is this a TOP Refund",DIR("??")="Enter 'YES' only if this is a refund of a payment from TOP"
87 D ^DIR Q:'Y
88 S DEBTOR=$P(^PRCA(430,PRCABN,0),U,9) Q:'DEBTOR
89 S TRACE=$P($G(^RCD(340,DEBTOR,6)),U,7)
90 I $L(TRACE)'=10 W !,*7,"There is no valid trace number entered for this debtor",!,"Cannot process as TOP refund." Q
91 S CLYRRF=$E(DT,1,3)+1700,DA=PRCABN
92 S DIE="^PRCA(430,",DR="144//^S X=CLYRRF;142////1;143///^S X=TRACE"
93 S DA=PRCABN,DIE("NO^")=1 D ^DIE
94 W !,"TOP REFUND DOCUMENT WILL BE SENT WITH NEXT TOP TRANSMISSION"
95 Q
96 ;
Note: See TracBrowser for help on using the repository browser.