source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCRCBL1.m@ 862

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1RCRCBL1 ;ALB/CMS - EOB PROCESSING LIST BUILD ; 09/02/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 ;
5BLDL ; build active list for EOB processing list
6 ; Returns: TMP("RCRCBL", TMP("RCRCBLBX" and VALMCNT
7 ;
8 K ^TMP("RCRCBL",$J,"B")
9 ;
10 N CNT,PRCABN,PRCATN,RCCNT,RCY
11 S (RCCNT,CNT,PRCABN,PRCATN)=0
12 F S PRCABN=$O(^PRCA(433,"AEOB",PRCABN)) Q:'PRCABN D
13 .I +$G(RCDIV(0)),'$$DIV^RCRCDIV(PRCABN) Q
14 .S PRCATN=0 F S PRCATN=$O(^PRCA(433,"AEOB",PRCABN,PRCATN)) Q:'PRCATN D
15 ..S RCCNT=$G(RCCNT)+1
16 ..D SCRN(PRCATN,RCCNT,PRCABN)
17 ..QUIT
18 ;
19 ;Add findings to list sorted by Pt. Name then Activation date
20 D RESL
21 ;
22BLDLQ K RCSTN,RCSI,RCSIF,RCSIL,RCRCI Q
23 ;
24SCRN(PRCATN,RCCNT,PRCABN) ;
25 ; add bill to screen list "B" sort (must Re Sequence List after)
26 ; Send: PRCATN,RCCNT,PRCABN
27 I '$G(^PRCA(433,+$G(PRCATN),0)) G SCRNQ
28 N PRCA,RCY,RCBN0,RCTN0,RCTN1,X,Y S X=""
29 S RCTN0=$G(^PRCA(433,+PRCATN,0))
30 S RCTN1=$G(^PRCA(433,+PRCATN,1))
31 S RCBN0=$G(^PRCA(430,+PRCABN,0))
32 D BNVAR^RCRCUTL(PRCABN),DEBT^RCRCUTL(PRCABN)
33 S RCY=$G(RCCNT),X=$$SETFLD^VALM1(RCY,X,"NUMBER")
34 S RCY=$P($G(^DPT(+$P(RCBN0,U,7),0),"UNK"),U,1),X=$$SETFLD^VALM1(RCY,X,"PATIENT")
35 S RCY=$P($P(RCBN0,U,1),"-",2),X=$$SETFLD^VALM1(RCY,X,"BILL")
36 S RCY=+$P(RCTN0,U,1),X=$$SETFLD^VALM1(RCY,X,"TRAN")
37 S RCY=$G(PRCA("DEBTNM")),X=$$SETFLD^VALM1(RCY,X,"DEBTOR")
38 S RCY=$$DATE(+$P(RCTN1,U,9)),X=$$SETFLD^VALM1(RCY,X,"DATE")
39 S RCY=+$P(RCTN1,U,5),X=$$SETFLD^VALM1($J(+RCY,9,2),X,"AMOUNT")
40 S ^TMP("RCRCBL",$J,"B",$G(PRCA("DEBTNM"),"UNK"),$P($G(^DPT(+$P(RCBN0,U,7),0),"UNK"),U,1),+PRCATN)=X
41SCRNQ Q
42 ;
43DATE(X) ; date in external format
44 N Y S Y="" I X?7N.E S Y=$$FMTE^XLFDT(X,"5ZD")
45 Q Y
46 ;
47RESL ;Build or Rebuild and sequence List with added or subtracted bill
48 N PRCATN,RCDBT,RCPT,X,Y
49 I '$D(^TMP("RCRCBL",$J,"B")) G RESLQ
50 S VALMCNT=0
51 S RCDBT="" F S RCDBT=$O(^TMP("RCRCBL",$J,"B",RCDBT)) Q:RCDBT="" S RCPT="" F S RCPT=$O(^TMP("RCRCBL",$J,"B",RCDBT,RCPT)) Q:RCPT="" D
52 .S PRCATN=0 F S PRCATN=$O(^TMP("RCRCBL",$J,"B",RCDBT,RCPT,PRCATN)) Q:'PRCATN D
53 ..S VALMCNT=VALMCNT+1
54 ..S X=^TMP("RCRCBL",$J,"B",RCDBT,RCPT,PRCATN)
55 ..S RCY=VALMCNT,X=$$SETFLD^VALM1(RCY,X,"NUMBER")
56 ..S ^TMP("RCRCBL",$J,VALMCNT,0)=X
57 ..S ^TMP("RCRCBL",$J,"IDX",VALMCNT,VALMCNT)=""
58 ..S ^TMP("RCRCBLX",$J,VALMCNT)=VALMCNT_U_PRCATN
59 ..D FLDCTRL^VALM10(VALMCNT)
60RESLQ Q
61 ;RCRCBL1
Note: See TracBrowser for help on using the repository browser.