source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBUCDE.m@ 949

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1FBUCDE ;BOIFO/SGJ-UNAUTHORIZED EDI CLAIMS THAT WERE NOT APPROVED ;12/18/03
2 ;;3.5;FEE BASIS;**69**;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 N FBX
6 ; ask date range
7 S DIR(0)="D^::EX",DIR("A")=" Beginning Date"
8 ; default from date is first day of current month
9 S DIR("B")=$$FMTE^XLFDT($E(DT,1,5)_"01")
10 D ^DIR K DIR Q:$D(DIRUT)
11 S FBBEG=Y
12 S DIR(0)="DA^"_FBBEG_"::EX",DIR("A")=" Ending Date: "
13 ; default to date is last day of specified month
14 D NOW^%DTC S DIR("B")=$$FMTE^XLFDT(X)
15 D ^DIR K DIR Q:$D(DIRUT)
16 S FBEND=Y
17 ;
18 ; ask device
19 S %ZIS="QM" D ^%ZIS G:POP EXIT
20 I $D(IO("Q")) D G EXIT
21 . S ZTRTN="QEN^FBUCDE",ZTDESC="UNAUTHORIZED EDI CLAIMS REPORT"
22 . F FBX="FBBEG","FBEND" S ZTSAVE(FBX)=""
23 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
24 ;
25QEN ; queued entry
26 U IO
27 ;
28GATHER ; collect and sort data by date
29 N FBSET,FBFPPSC,FBC,FBPG,FBHDT,FBDA,FBDTR
30 S (FBQUIT,FBPG)=0
31 D NOW^%DTC S FBDTR=$$DATX^FBAAUTL(X)
32 K FBDL S FBDL="",$P(FBDL,"=",IOM)=""
33 ; build page header text for selection criteria
34 S FBHDT(1)="From Date: "_$$DATX^FBAAUTL(FBBEG)_" To Date: "_$$DATX^FBAAUTL(FBEND)
35 ;
36 D HD
37 S FBBEG=FBBEG-.0000001
38 S FBEND=FBEND+.999999
39 K ^TMP("FBDE")
40 ;
41 ; Initialize Counter
42 S FBC=0
43 ;
44 S FBSET=" Reason for Disapproval: "
45 ;
46 S (FBFPPSC,FBDA)=""
47 F S FBFPPSC=$O(^FB583("AFC",FBFPPSC)) Q:FBFPPSC="" F S FBDA=$O(^FB583("AFC",FBFPPSC,FBDA)) Q:FBDA="" D ONE
48 D PRINT
49 ;
50 I FBC=0 W !!,"no entries found.",!
51 ;
52 I FBQUIT W !!,"REPORT STOPPED AT USER REQUEST",!
53 ;
54 I 'FBQUIT,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
55 D ^%ZISC
56 G EXIT
57 Q
58 ;
59HD ; page header
60 N FBI
61 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,FBQUIT=1 Q
62 I $E(IOST,1,2)="C-",FBPG S DIR(0)="E" D ^DIR K DIR I 'Y S FBQUIT=1 Q
63 I $E(IOST,1,2)="C-"!FBPG W @IOF
64 S FBPG=FBPG+1
65 W !,"UNAUTHORIZED EDI CLAIMS THAT WERE NOT APPROVED",?67,FBDTR
66 S FBI=0 F S FBI=$O(FBHDT(FBI)) Q:'FBI W !,FBHDT(FBI)
67 W ?68,"Page: ",FBPG
68 W !!,"Date of Disposition",?23,"Disposition",?42,"FPPS Claim ID",?62,"Fee Program"
69 W !?2,"Veteran",?38,"Vendor"
70 W !?2,"Treatment From",?31,"Treatment To",?58,"Amt Claimed"
71 W !,FBDL
72 Q
73 ;
74ONE N FBZ,FBDT
75 S FBZ=$G(^FB583(FBDA,0))
76 S FBDT=$P(FBZ,U,12)
77 ; skip if date of disposition not within specified period
78 Q:FBDT=""!(FBDT>FBEND)!(FBDT<FBBEG)
79 ; skip if disposition is not equal to disapproved,
80 ; cancelled/withdrawn or abandoned.
81 Q:"^1^4^"[(U_$P(FBZ,U,11)_U)
82 ; store the ien in list (sorted by date of disposition)
83 S ^TMP("FBDE",$J,FBDT,FBDA,FBFPPSC)=""
84 Q
85PRINT ; print claims
86 N I,FBZ,FBAC
87 S FBDT="" F S FBDT=$O(^TMP("FBDE",$J,FBDT)) Q:FBDT="" D Q:FBQUIT
88 . S FBDA="" F S FBDA=$O(^TMP("FBDE",$J,FBDT,FBDA)) Q:FBDA="" D Q:FBQUIT
89 . . S FBC=FBC+1,I=""
90 . . S FBZ=$G(^FB583(FBDA,0))
91 . . S FBAC=$P(FBZ,U,9)+.0001,FBAC=$P(FBAC,".",1)_"."_$E($P(FBAC,".",2),1,2)
92 . . I $Y+9>IOSL D HD Q:FBQUIT
93 . . W !!,$$DATX^FBAAUTL($E(FBDT,1,7)),?21,$E($P($$PTR^FBUCUTL("^FB(162.91,",$P(FBZ,U,11)),U),1,30),?44,$O(^TMP("FBDE",$J,FBDT,FBDA,0)),?62,$$PROG^FBUCUTL($P(FBZ,U,2))
94 . . W !?2,$E($$VET^FBUCUTL($P(FBZ,U,4)),1,30),?35,$E($$VEN^FBUCUTL($P(FBZ,U,3)),1,30)
95 . . W !?2,$$DATX^FBAAUTL($E($P(FBZ,U,5),1,7)),?32,$$DATX^FBAAUTL($E($P(FBZ,U,6),1,7)),?58,$J(FBAC,6)
96 . . F S I=$O(^FB583(FBDA,"D","B",I)) Q:I="" W !,FBSET_$P(^FB(162.94,I,0),U)
97 Q
98EXIT ; kill variables, tmp global and quit
99 S:$D(ZTQUEUED) ZTREQ="@"
100 K %,DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,POP,X,Y
101 K ^TMP("FBDE"),FBBEG,FBEND,FBQUIT,FBDL
102 Q
103 ;FBUCDE
Note: See TracBrowser for help on using the repository browser.