source: FOIAVistA/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCBDPSLM.m@ 1569

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1RCBDPSLM ;WISC/RFJ-patient statement top list manager routine ;1 Dec 00
2 ;;4.5;Accounts Receivable;**162,198**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 N RCDEBTDA
6 ;
7 F D Q:'RCDEBTDA
8 . W !! S RCDEBTDA=$$SELACCT
9 . I RCDEBTDA<1 S RCDEBTDA=0 Q
10 . D EN^VALM("RCBD PATIENT STATEMENT")
11 Q
12 ;
13 ;
14INIT ; initialization for list manager list
15 N ORIGAMT,RCBILLDA,RCDATE,RCEVENDA,RCEVENT,RCFINCOM,RCLINE,RCOUTBAL,RCSTATE,RCSTDATE,RCTOTAL,RCTRANDA,RCTRCNT,RCVALUE
16 K ^TMP("RCBDPSLM",$J),^TMP("RCBDPSLMDATA",$J)
17 ;
18 ;
19 ; get the last event (patient statement) entry
20 S RCEVENDA=$$LASTEVNT^RCBDFST1(RCDEBTDA)
21 I RCEVENDA D EVENTBAL^RCBDFST1(+RCEVENDA)
22 ;
23 ; build list of bills (original amount) by statement date
24 S RCDATE=0 F S RCDATE=$O(^PRCA(430,"ATD",RCDEBTDA,RCDATE)) Q:'RCDATE D
25 . S RCBILLDA=0 F S RCBILLDA=$O(^PRCA(430,"ATD",RCDEBTDA,RCDATE,RCBILLDA)) Q:'RCBILLDA D
26 . . S ORIGAMT=+$P(^PRCA(430,RCBILLDA,0),"^",3) I 'ORIGAMT Q
27 . . ;
28 . . ; estimate statement date
29 . . S RCSTATE=$P(RCEVENDA,"^",2)
30 . . I RCDATE>$P(RCEVENDA,"^",2) S RCSTATE=10000000
31 . . ;
32 . . S ^TMP("RCBDPSLMDATA",$J,RCDEBTDA,RCSTATE,RCDATE,0)=RCBILLDA_"^"_ORIGAMT
33 ;
34 ; build list of transactions by statement date
35 S RCDATE=0 F S RCDATE=$O(^PRCA(433,"ATD",RCDEBTDA,RCDATE)) Q:'RCDATE D
36 . S RCTRANDA=0 F S RCTRANDA=$O(^PRCA(433,"ATD",RCDEBTDA,RCDATE,RCTRANDA)) Q:'RCTRANDA D
37 . . ; get transaction value, no value, quit
38 . . S RCVALUE=$$TRANVALU^RCDPBTLM(RCTRANDA) I RCVALUE="" Q
39 . . ; special case for prepayments (26)
40 . . I $P(^PRCA(430,+$P($G(^PRCA(433,RCTRANDA,0)),"^",2),0),"^",2)=26 D
41 . . . S $P(RCVALUE,"^",2)=-$P(RCVALUE,"^",2)
42 . . ;
43 . . ; estimate statement date
44 . . S RCSTATE=$P(RCEVENDA,"^",2)
45 . . I RCDATE>$P(RCEVENDA,"^",2) S RCSTATE=10000000
46 . . I $P(^PRCA(433,RCTRANDA,0),"^",10) S RCSTATE=10000000
47 . . ;
48 . . S ^TMP("RCBDPSLMDATA",$J,RCDEBTDA,RCSTATE,RCDATE,RCTRANDA)=RCVALUE
49 ;
50 D INITCONT^RCBDPSL1
51 Q
52 ;
53 ;
54HDR ; header code for list manager display
55 D HDR^RCDPAPLM
56 Q
57 ;
58 ;
59EXIT ; exit list manager option and clean up
60 K ^TMP("RCBDPSLM",$J),^TMP("RCBDPSLMDATA",$J)
61 Q
62 ;
63 ;
64SELACCT() ; select a first party acct
65 ; returns -1 for timeout or ^, 0 for no selection, or ien of bill
66 N %,%Y,C,DIC,DILN,DTOUT,DUOUT,X,Y
67 N DPTNOFZY,DPTNOFZK S (DPTNOFZY,DPTNOFZK)=1
68 S DIC="^RCD(340,",DIC(0)="QEAM",DIC("A")="Select First Party ACCOUNT: "
69 S DIC("S")="I $P($G(^RCD(340,+Y,0)),U)[""DPT("""
70 D ^DIC
71 I Y<0,'$G(DUOUT),'$G(DTOUT) S Y=0
72 Q +Y
Note: See TracBrowser for help on using the repository browser.