source: FOIAVistA/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCRCVL2.m@ 770

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1RCRCVL2 ;ALB/CMS - RC VIEW BILL LIST SORT BUILD ; 09-SEP-97
2V ;;4.5;Accounts Receivable;**63,159**;MAR 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5BLDL ; - find data required for the report
6 N DFN,PRCABN,PRCABN0,RCAGE,RCAMT,RCCNT,RCCUR,RCY
7 I $O(RCSPT(0)) D BLDPT G BLDLQ Q
8 S (RCCNT,PRCABN)=0 W !,"Searching Active Bills for match "
9 F S PRCABN=$O(^PRCA(430,"AC",16,PRCABN)) Q:'PRCABN D GET
10BLDLQ K RCSBN,RCCAT,RCCNT,RCSI,RCSIA,RCSIF,RCSPT,RCSIL,RCSAGN,RCSAGX,RCSAMT,RCSRC
11 Q
12 ;
13BLDPT ;If pt. selection use E cross-ref
14 N DFN,PRCABN S (RCCNT,DFN)=0
15 W !,"Searching TP bills for match "
16 F S DFN=$O(RCSPT(DFN)) Q:'DFN S PRCABN=0 D
17 .F S PRCABN=$O(^PRCA(430,"E",DFN,PRCABN)) Q:'PRCABN D GET
18 Q
19 ;
20GET ;
21 N RCPDIV,RCDIV,RCX
22 S PRCABN0=$G(^PRCA(430,PRCABN,0))
23 ; - check status must be active
24 I $P(PRCABN0,U,8)'=16 Q
25 ; - check referral category
26 S RCCAT="" D RCCAT^RCRCUTL(.RCCAT)
27 I '$D(RCCAT(+$P(PRCABN0,U,2))) Q
28 ; - check division if necessary
29 I +$G(RCDIV(0)),'$$DIV^RCRCDIV(PRCABN) Q
30 ; - check the receivable age if necessary
31 I +$G(RCSAGN)=0,+$G(RCSAGX)=0 G AMT
32 S RCAGE=$$ACTDT^RCRCUTL(PRCABN) Q:'RCAGE
33 S RCAGE=$$FMDIFF^XLFDT(DT,RCAGE)
34 I $G(RCSAGN),RCAGE<RCSAGN Q
35 I $G(RCSAGX),RCAGE>RCSAGX Q
36AMT ; - check the cur bal of bill if necessary
37 I $G(RCSAMT) S RCAMT=$$BILL^RCJIBFN2(PRCABN) I $P(RCAMT,U,3)<RCSAMT Q
38 ; - exclude receivables referred to Regional Counsel if necessary
39 I '$G(RCSRC) I $P($G(^PRCA(430,PRCABN,6)),"^",4) Q
40 ; - check debtor insurance carrier
41 I $D(RCSI),'$$INS Q
42 S RCCNT=$G(RCCNT)+1 W "."
43 D SCRN^RCRCVL1(PRCABN)
44 Q
45 ;
46INS() ; Get the Insurance company and check to include
47 ;
48 N PRCA,RCIN
49 I $G(RCSIA)="ALL" S Y=1 G INSQ
50 I $G(RCSIA)="NULL",$P(PRCABN0,U,9)="" S Y=1 G INSQ
51 I $G(RCSIA)="NULL",+$P(PRCABN0,U,9) S Y=0 G INSQ
52 I $O(RCSI(0)),$D(RCSI(+$P(PRCABN0,U,9))) S Y=1 G INSQ
53 I $O(RCSI(0)),'$D(RCSI(+$P(PRCABN0,U,9))) S Y=0 G INSQ
54 D DEBT^RCRCUTL(PRCABN)
55 I $G(PRCA("DEBTNM"))="",$G(RCSIF)='"@" S Y=0 G INSQ
56 I PRCA("DEBTNM")]$G(RCSIL) S Y=0 G INSQ
57 I $G(RCSIF)="" S Y=1 G INSQ
58 I $G(RCSIF)]PRCA("DEBTNM") S Y=0 G INSQ
59 S Y=1
60INSQ Q Y
61 ;RCRCVL2
Note: See TracBrowser for help on using the repository browser.