source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCRCAL2.m@ 1154

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1RCRCAL2 ;ALB/CMS - RC ACTION BILL LIST SORT BUILD ; 16-JUN-00
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,RCRDT,RCY
7 I $O(RCSPT(0)) D BLDPT G BLDLQ Q
8 S (RCCNT,RCRDT)=0 W !,"Searching Referred Bills for match "
9 F S RCRDT=$O(^PRCA(430,"AD",RCRDT)) Q:'RCRDT D
10 .S PRCABN=0 F S PRCABN=$O(^PRCA(430,"AD",RCRDT,PRCABN)) Q:'PRCABN D GET
11BLDLQ K RCSBN,RCCAT,RCCNT,RCSI,RCSIA,RCSIF,RCSPT,RCSIL
12 Q
13 ;
14BLDPT ;If pt. selection use E cross-ref
15 N DFN,PRCABN S (RCCNT,DFN)=0
16 W !,"Searching TP bills for match "
17 F S DFN=$O(RCSPT(DFN)) Q:'DFN S PRCABN=0 D
18 .F S PRCABN=$O(^PRCA(430,"E",DFN,PRCABN)) Q:'PRCABN D GET
19 Q
20 ;
21GET ;
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
29 I +$G(RCDIV(0)),'$$DIV^RCRCDIV(PRCABN) Q
30 ; - check debtor insurance carrier
31 I $D(RCSI),'$$INS Q
32 S RCCNT=$G(RCCNT)+1 W "."
33 D SCRN^RCRCAL1(PRCABN)
34 Q
35 ;
36INS() ; Get the Insurance company and check to include
37 ;
38 N PRCA,RCIN
39 I $G(RCSIA)="ALL" S Y=1 G INSQ
40 I $G(RCSIA)="NULL",$P(PRCABN0,U,9)="" S Y=1 G INSQ
41 I $G(RCSIA)="NULL",+$P(PRCABN0,U,9) S Y=0 G INSQ
42 I $O(RCSI(0)),$D(RCSI(+$P(PRCABN0,U,9))) S Y=1 G INSQ
43 I $O(RCSI(0)),'$D(RCSI(+$P(PRCABN0,U,9))) S Y=0 G INSQ
44 D DEBT^RCRCUTL(PRCABN)
45 I $G(PRCA("DEBTNM"))="",$G(RCSIF)='"@" S Y=0 G INSQ
46 I PRCA("DEBTNM")]$G(RCSIL) S Y=0 G INSQ
47 I $G(RCSIF)="" S Y=1 G INSQ
48 I $G(RCSIF)]PRCA("DEBTNM") S Y=0 G INSQ
49 S Y=1
50INSQ Q Y
51 ;RCRCAL2
Note: See TracBrowser for help on using the repository browser.