source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPEV0.m@ 767

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

initial load of WorldVistAEHR

File size: 4.8 KB
Line 
1RCDPEV0 ;ALB/TMK - EDI LOCKBOX WORKLIST VERIFY PAYMENTS ;18-FEB-04
2 ;;4.5;Accounts Receivable;**208**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6RPT(RCSCR) ; Print/display discrepancy report
7 D FULL^VALM1
8 N %ZIS,ZTRTN,ZTSAVE,ZTDESC,POP
9 S %ZIS="QM" D ^%ZIS G:POP RPTQ
10 I $D(IO("Q")) D G RPTQ
11 . S ZTRTN="DISRPT^RCDPEV("_RCSCR_","_+$G(^TMP("RCBATCH_SELECTED",$J))_")",ZTDESC="AR - Print ERA Discrepancy Report From Worklist"
12 . D ^%ZTLOAD
13 . W !!,$S($D(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
14 . K ZTSK,IO("Q") D HOME^%ZIS
15 U IO
16 D DISRPT(RCSCR,+$G(^TMP("RCBATCH_SELECTED",$J)))
17RPTQ Q
18 ;
19DISRPT(RCSCR,RCBATCH) ; Queued job entrypoint
20 ; RCSCR = the ien of the entry in file 344.49
21 ; RCBATCH = the # of the batch within the ERA. If all batches, this is null
22 N X,Z,Z0,RC3444,RCSTOP,RCPG,RCANY,RCZ,RCZ0,RCZ1,SPLIT,SSN,AMT1,AMT2,RCBILL,RESULT,DTFR1,DTFR2,DTTO1,DTTO2
23 S (RCSTOP,RCPG,RCANY)=0
24 S RCZ=0 F S RCZ=$O(^RCY(344.49,RCSCR,1,"ANV",0,RCZ)) Q:'RCZ D Q:RCSTOP
25 . I $D(ZTQUEUED),$$S^%ZTLOAD S (RCSTOP,ZTSTOP)=1 K ZTREQ W:+$G(RCPG) !,"***TASK STOPPED BY USER***" Q
26 . S RCZ0=$G(^RCY(344.49,RCSCR,1,RCZ,0))
27 . Q:'$D(^RCY(344.49,RCSCR,1,"ASEQ",+RCZ0,RCZ)) ; Not top level
28 . Q:RCZ0=""
29 . I $G(RCBATCH),$P(RCZ0,U,14)'=RCBATCH Q ; Not in the batch
30 . S RCANY=1
31 . S SPLIT=(+$O(^RCY(344.49,RCSCR,1,"B",+RCZ0_".9999"),-1)'=(+RCZ0_".001"))
32 . S RC3444=$G(^RCY(344.4,RCSCR,1,+$P(RCZ0,U,9),0))
33 . S RCBILL=+$G(^IBM(361.1,+$P(RC3444,U,2),0))
34 . S RESULT=$$VER^RCDPEV(RCSCR,RCBILL,+$P(RCZ0,U,9),1)
35 . S AMT1=$S($E($P(RESULT,U,5))="*":"*",1:"")_$S($TR($P(RESULT,U,5),"*")="":"NO DATA",1:$J($TR($P(RESULT,U,5),"*"),"",2))
36 . S AMT2=$S($E($P(RESULT,U,4))="*":"*",1:"")_$S($TR($P(RESULT,U,4),"*")="":"NO DATA",1:$J($TR($P(RESULT,U,4),"*"),"",2))
37 . S DTFR1=$S($TR($P(RESULT,U,7),"*")="":"",1:$S($E($P(RESULT,U,7))="*":"*",1:"")_$$FMTE^XLFDT($TR($P(RESULT,U,7),"*"),"2D"))
38 . S DTFR2=$S($TR($P(RESULT,U,6),"*")="":"",1:$S($E($P(RESULT,U,6))="*":"*",1:"")_$$FMTE^XLFDT($TR($P(RESULT,U,6),"*"),"2D"))
39 . S DTTO1=$S($TR($P(RESULT,U,9),"*")="":"",1:$S($E($P(RESULT,U,9))="*":"*",1:"")_$$FMTE^XLFDT($TR($P(RESULT,U,9),"*"),"2D"))
40 . S DTTO2=$S($TR($P(RESULT,U,8),"*")="":"",1:$S($E($P(RESULT,U,8))="*":"*",1:"")_$$FMTE^XLFDT($TR($P(RESULT,U,8),"*"),"2D"))
41 . S X="EEOB Sequence #(s) on the ERA: "_$P(RCZ0,U,9)_" "_$S($P(RC3444,U,5)'="":$P(RC3444,U,5),$P(RC3444,U,17)'="":$P(RC3444,U,17),$G(RCBILL):$P($G(^DGCR(399,+RCBILL,0)),U),1:"")
42 . I ($Y+7)>IOSL!'RCPG D HDR(.RCPG,RCSCR,$G(RCBATCH),.RCSTOP) Q:RCSTOP
43 . W !!,X
44 . I ($Y+5)>IOSL D HDR(.RCPG,RCSCR,$G(RCBATCH),.RCSTOP) Q:RCSTOP
45 . S X="VistA: ",SSN=$P(RESULT,U,10),SSN=$E($E(SSN,$L(SSN)-3,$L(SSN))_$J("",4),1,4)
46 . S X=X_$S('RCBILL:"NOT RELATED TO A VistA BILL",1:$E($P(RESULT,U,2)_$J("",30),1,30)_" "_SSN_" "_$E(AMT2_$J("",15),1,15)_" "_$E($S(DTFR2="":"NO DATA",1:DTFR2)_$J("",9),1,9)_"-"_$S(DTTO2'="":DTTO2,1:"NO DATA"))
47 . W !,X
48 . S X=" ERA: "_$E($P(RESULT,U,3)_$J("",30),1,30)_$J("",7)_$E(AMT1_$J("",15),1,15)_" "_$E($S(DTFR1="":"NO DATA",1:DTFR1)_$J("",9),1,9)_"-"_$S(DTTO1'="":DTTO1,1:"NO DATA")
49 . W !,X
50 . Q:'SPLIT
51 . W !,?9,"<<< THIS EEOB HAS BEEN SPLIT >>>"
52 . S RCZ1=+RCZ0 F S RCZ1=$O(^RCY(344.49,RCSCR,1,"B",RCZ1)) Q:(RCZ1\1)'=+RCZ0!RCSTOP D
53 .. S Z=+$O(^RCY(344.49,RCSCR,1,"B",RCZ1,0))
54 .. S Z0=$G(^RCY(344.49,RCSCR,1,Z,0))
55 .. I ($Y+5)>IOSL D HDR(.RCPG,RCSCR,$G(RCBATCH),.RCSTOP) Q:RCSTOP
56 .. W !,?15,$S($P(Z0,U,7):"",1:"BILL NOT IN VISTA: "),$P(Z0,U,2)_" "_$J($P(Z0,U,5),"",2)
57 . W !
58 ;
59 I 'RCANY D:'RCPG HDR(.RCPG,RCSCR,$G(RCBATCH),.RCSTOP) W !,"THERE ARE NO UNVERIFIED LINES WITH DISCREPANCIES IN THIS ERA"_$S($G(RCBATCH):" BATCH",1:"")
60 I '$D(ZTQUEUED),'RCSTOP,RCPG D ASK()
61 I $D(ZTQUEUED) S ZTREQ="@"
62 I '$D(ZTQUEUED) D ^%ZISC
63 Q
64 ;
65HDR(RCPG,RCSCR,RCBATCH,RCSTOP) ;Print report hdr
66 ; RCPG = last page #
67 ; RCSCR = the entry # in file 344.49
68 ; RCSTOP = returned as 1 if abort is detected
69 N RCZ0
70 I $D(ZTQUEUED),$$S^%ZTLOAD S (RCSTOP,ZTSTOP)=1 K ZTREQ W:+$G(RCPG) !,"***TASK STOPPED BY USER***" Q
71 S RCZ0=$G(^RCY(344.4,RCSCR,0))
72 I RCPG&($E(IOST,1,2)="C-") D ASK(.RCSTOP) Q:RCSTOP
73 W !,@IOF,*13
74 S RCPG=$G(RCPG)+1
75 W !,"EDI LBOX WORKLIST - UNVERIFIED LINES DISCREPANCIES REPORT",?59,$$FMTE^XLFDT(DT,2),?70,"Page: ",RCPG,!
76 W !,"ERA #: ",RCSCR,?20,$S($O(^RCY(344.49,RCSCR,3,0)):"BATCH: "_$E($S($G(RCBATCH):+RCBATCH,1:"ALL")_$J("",11),1,11),1:$J("",18))_"TRACE #: "_$P(RCZ0,U,2)
77 W !,"PAYER: "_$E($P(RCZ0,U,6)_$J("",30),1,30)_" ERA DT: "_$$FMTE^XLFDT($P(RCZ0,U,4),"2D")
78 W !!,?7,"PATIENT NAME"_$J("",25)_"SUBMITTED AMT SVC DATE(S)"
79 W !,"* preceding data = data has discrepancy"
80 W !,$TR($J("",IOM)," ","=")
81 Q
82 ;
83ASK(RCSTOP) ; Ask to continue
84 ; If passed by reference ,RCSTOP is returned as 1 if print is aborted
85 I $E(IOST,1,2)'["C-" Q
86 N DIR,DIROUT,DIRUT,DTOUT,DUOUT
87 S DIR(0)="E" W ! D ^DIR
88 I ($D(DIRUT))!($D(DUOUT)) S RCSTOP=1 Q
89 Q
90 ;
Note: See TracBrowser for help on using the repository browser.