source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBTOECT.m@ 1799

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

initial load of WorldVistAEHR

File size: 5.8 KB
RevLine 
[613]1IBTOECT ;OAK/ELZ- ENHANCED CLAIMS TRACKING REPORTS ;7/15/2005
2 ;;2.0;INTEGRATED BILLING;**317**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5UNREV ; Main entry for the Un-reviewed Claims for Coders Report
6 ;
7 N IBBEG,IBEND
8 ;
9 D DATE^IBCONS4 Q:'$D(IBBEG)!('$D(IBEND))
10 Q:$$DEV("QUNREV","IB - Unreviewed Claims for Coders Report")
11 ;
12QUNREV ; tasman entry
13 U IO
14 N IBOE,IBX,IBCT0,IBCT2,IBPNAM,IBSSN,IBOE0,IBY,IBR,IBP,IBL,IBCPT,IBMOD,IBA,IBONE,IBC,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
15 K ^TMP("IBTOECT",$J) S IBP=0,$P(IBL,"-",IOM)=""
16 ;
17 ; create sort by Outpatient Encounter then by patient name (no x-ref supports this)
18 S IBOE=$$FMADD^XLFDT($P(IBBEG,"."),-1)+.99 F S IBOE=$O(^IBT(356,"D",IBOE)) Q:'IBOE!(IBOE>(IBEND_".9999")) S IBX=0 F S IBX=$O(^IBT(356,"D",IBOE,IBX)) Q:'IBX D
19 . S IBCT0=$G(^IBT(356,IBX,0)),IBCT2=$G(^(2))
20 . I $P(IBCT0,"^",4),$P(IBCT0,"^",24),'$P(IBCT0,"^",19),'$P(IBCT2,"^",3),$P(IBCT0,"^",2) S ^TMP("IBTOECT",$J,IBOE,$P(^DPT($P(IBCT0,"^",2),0),"^"),IBX)=""
21 ;
22 ;
23 S IBOE=0 F S IBOE=$O(^TMP("IBTOECT",$J,IBOE)) Q:'IBOE!($D(DIRUT)) S IBPNAM="" F S IBPNAM=$O(^TMP("IBTOECT",$J,IBOE,IBPNAM)) Q:IBPNAM=""!($D(DIRUT)) S IBX=0 F S IBX=$O(^TMP("IBTOECT",$J,IBOE,IBPNAM,IBX)) Q:'IBX!($D(DIRUT)) D
24 . S IBCT0=$G(^IBT(356,IBX,0)) Q:'IBCT0
25 . S IBSSN=$P($G(^DPT(+$P(IBCT0,"^",2),0)),"^",9)
26 . S IBOE0=$G(^SCE(+$P(IBCT0,"^",4),0))
27 . S IBY=$$INSUR^IBBAPI($P(IBOE0,"^",2),+IBOE0,"RB",.IBR,"1,11,16")
28 . S IBCPT=0,IBONE=0
29 . ;
30 . I 'IBP!($Y+3>IOSL) D
31 . . I $E(IOST,1,2)="C-",IBP'=0 S DIR(0)="E" D ^DIR I $D(DIRUT) Q
32 . . S IBP=IBP+1
33 . . W @IOF,!,"Unreviewed Claims for Coders Report from ",$$FMTE^XLFDT(IBBEG)," to ",$$FMTE^XLFDT(IBEND),?100,$$FMTE^XLFDT(DT),?115,"Page: ",IBP
34 . . W !,"Patient Name",?27,"SSN",?39,"Visit Date",?58,"Location",?80,"CPTs",?87,"Mod",?91,"Insurance",?113,"Exp Date",?125,"Bill",!,IBL
35 . Q:$D(DIRUT)
36 . W:$X ! W $E(IBPNAM,1,25),?27,IBSSN,?39,$$FMTE^XLFDT(+IBOE0,2),?58,$E($P($G(^SC(+$P(IBOE0,"^",4),0)),"^"),1,20)
37 . S:$P(IBCT0,"^",3) IBCPT=$$GETIENS^PXAAVCPT($P(IBCT0,"^",3),.IBCPT)
38 . S (IBC,IBCPT)=0 F S IBCPT=$O(IBCPT(IBCPT)) Q:'IBCPT D
39 . . S IBC=IBC+1,IBONE=1
40 . . S IBA(IBC)=$$CPT^PXAAVCPT(IBCPT)
41 . . D:$P(IBCT0,"^",3) CPTMODIF^PXAAVCPT($P(IBCT0,"^",3),.IBMOD)
42 . . S IBMOD=0 F S IBMOD=$O(IBMOD(1,IBMOD)) Q:'IBMOD D
43 . . . S:'IBONE IBC=IBC+1
44 . . . S $P(IBA(IBC),"^",2)=$G(IBMOD(1,+IBMOD,0))
45 . . . S IBONE=0
46 . F IBC=1:1 Q:'$D(IBA(IBC))&('$D(IBR("IBBAPI","INSUR",IBC))) D
47 . . W:$G(IBA(IBC)) ?80,$P($$CPT^ICPTCOD(+$G(IBA(IBC)),+IBOE0),"^",2)
48 . . W:$P($G(IBA(IBC)),"^",2) ?87,$P($$MOD^ICPTMOD(+$P($G(IBA(IBC)),"^",2),"I",+IBOE0),"^",2)
49 . . W ?91,$E($P($G(IBR("IBBAPI","INSUR",IBC,1)),"^",2),1,20)
50 . . W:$G(IBR("IBBAPI","INSUR",IBC,11)) ?113,$$FMTE^XLFDT($G(IBR("IBBAPI","INSUR",IBC,11)),2)
51 . . W ?125,$P($G(IBR("IBBAPI","INSUR",IBC,16)),"^",2),!
52 . K IBA
53 ;
54 ;
55 K ^TMP("IBTOECT",$J)
56 D ^%ZISC
57 S:$D(ZTQUEUED) ZTREQ="@"
58 Q
59 ;
60ENR ; entered/not reviewed report
61 ;
62 N IBBEG,IBEND
63 ;
64 D DATE^IBCONS4 Q:'$D(IBBEG)!('$D(IBEND))
65 Q:$$DEV("QENR","IB - Entered/Not Reviewed Bills Report")
66 ;
67QENR ; tasked entry
68 ;
69 N IBDT,IB0,IBR,IBPNAM,IBX,DFN,IBP,IBL,IBPNAMS,IBCP,IBC,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,IBA
70 U IO
71 K ^TMP("IBTOECT",$J)
72 ;
73 ;set up some variables
74 S IBR=$S($O(^DGCR(399.3,"B","REIMBURSABLE INS.",0)):$O(^DGCR(399.3,"B","REIMBURSABLE INS.",0)),1:8)
75 S IBP=0,$P(IBL,"-",IOM)="",IBPNAMS=""
76 ;
77 ; find the bills that match criteria and sort in ^tmp
78 S IBDT=$$FMADD^XLFDT($P(IBBEG,"."),-1)+.99 F S IBDT=$O(^DGCR(399,"D",IBDT)) Q:'IBDT!(IBDT>(IBEND_".9999")) S IBX=0 F S IBX=$O(^DGCR(399,"D",IBDT,IBX)) Q:'IBX S IB0=^DGCR(399,IBX,0) D
79 . I $P(IB0,"^",7)=IBR,$P(IB0,"^",5)=3,$P(IB0,"^",13)=1 S ^TMP("IBTOECT",$J,$P(^DPT($P(IB0,"^",2),0),"^"),IBDT,IBX)=""
80 ;
81 S IBPNAM="" F S IBPNAM=$O(^TMP("IBTOECT",$J,IBPNAM)) Q:IBPNAM=""!($D(DIRUT)) S IBDT=0 F S IBDT=$O(^TMP("IBTOECT",$J,IBPNAM,IBDT)) Q:'IBDT!($D(DIRUT)) S IBX=0 F S IBX=$O(^TMP("IBTOECT",$J,IBPNAM,IBDT,IBX)) Q:'IBX!($D(DIRUT)) D
82 . S IB0=$G(^DGCR(399,IBX,0)),DFN=$P(IB0,"^",2) Q:'DFN
83 . D DEM^VADPT,ELIG^VADPT
84 . I 'IBP!($Y+5>IOSL) D
85 . . I $E(IOST,1,2)="C-",IBP'=0 S DIR(0)="E" D ^DIR I $D(DIRUT) Q
86 . . S IBP=IBP+1
87 . . W @IOF,!,"Entered/Not Reviewed Bills Report from ",$$FMTE^XLFDT(IBBEG)," to ",$$FMTE^XLFDT(IBEND),?100,$$FMTE^XLFDT(DT),?115,"Page: ",IBP
88 . . W !,"Bill #",?12,"Primary Insurance",?34,"Clinic",?44,"Date",?56,"Proc",?63,"Provider",?85,"RNB",?107,"Billable Findings",!,IBL
89 . Q:$D(DIRUT)
90 . W:IBPNAMS'=IBPNAM !,"Name: ",$E(VADM(1),1,25),?33,"Sex: ",$P(VADM(5),"^"),?42,"SSN: ",$P(VADM(2),"^",2),?61,"Age: ",VADM(4),?70,"MT Status: ",$P(VAEL(9),"^",2)
91 . S IBPNAMS=IBPNAM
92 . W:$X ! W $P(IB0,"^"),?12,$E($P($G(^DIC(36,+^DGCR(399,IBX,"M"),0)),"^"),1,20)
93 . ; IBA format: 399 sub CP ien ^ RNB (ien) (only one) ^ billable findings description (ien)
94 . S (IBCP,IBC)=0 F S IBCP=$O(^DGCR(399,IBX,"CP",IBCP)) Q:'IBCP S IBC=IBC+1,IBA(IBC)=IBCP
95 . S IBCT=$O(^IBT(356,"E",IBX,0)),$P(IBA(1),"^",2)=$P($G(^IBT(356,+IBCT,0)),"^",19)
96 . S (IBCP,IBC)=0 F S IBCP=$O(^IBT(356,+IBCT,3,IBCP)) Q:'IBCP S IBC=IBC+1,$P(IBA(IBC),"^",3)=$G(^IBT(356,IBCT,3,IBCP,0))
97 . F IBC=1:1 Q:'$D(IBA(IBC)) D
98 . . S IBCP=$G(^DGCR(399,IBX,"CP",+IBA(IBC),0))
99 . . W ?34,$E($P($G(^SC(+$P(IBCP,"^",7),0)),"^"),1,7)
100 . . W ?44,$$FMTE^XLFDT($P(IBCP,"^",2),2)
101 . . W ?56,$$EXTERNAL^DILFD(399.0304,.01,,$P(IBCP,"^"))
102 . . W ?63,$E($P($G(^VA(200,+$P(IBCP,"^",18),0)),"^"),1,20)
103 . . W ?85,$E($P($G(^IBE(356.8,+$P(IBA(IBC),"^",2),0)),"^"),1,20)
104 . . W ?107,$E($P($G(^IBT(356.85,+$P(IBA(IBC),"^",3),0)),"^"),1,20),!
105 . K IBA
106 ;
107 K ^TMP("IBTOECT",$J)
108 D ^%ZISC
109 S:$D(ZTQUEUED) ZTREQ="@"
110 ;
111 Q
112 ;
113DEV(ZTRTN,ZTDESC) ; -- ask device
114 N ZTSAVE,IBRTN,%ZIS,POP,ZTSK
115 ;
116 W !!,"*** Margin width of this output is 132 ***"
117 W !,"*** This output should be queued ***"
118 ;
119 S %ZIS="QM" D ^%ZIS I POP Q 1
120 I $D(IO("Q")) D Q 1
121 .S ZTRTN=ZTRTN_"^IBTOECT",ZTSAVE("IB*")=""
122 .D ^%ZTLOAD,HOME^%ZIS W "Task #",ZTSK K IO("Q")
123 Q 0
Note: See TracBrowser for help on using the repository browser.