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

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

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1IBCERP6 ;ALB/JEH - MRA/EDI CLAIMS READY FOR EXTRACT ;12/10/99
2 ;;2.0;INTEGRATED BILLING;**137,211,155,348,349**;21-MAR-94;Build 46
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5EN ;Entry point from option
6 W !!,"This report provides a list of claims held in a"
7 W !,"Ready for Extract status. Users can select all bills"
8 W !,"in a Ready for extract status or only those trapped due to"
9 W !,"the EDI/MRA Parameters being turned off."
10 ;
11 S IBQUIT=0 D SELECT I IBQUIT G ENQ1
12 S IBQUIT=0 D PARAM I IBQUIT G ENQ1
13 ;
14 W !!,"This report requires a 132 column printer.",!!
15 ; - Ask device
16 N %ZIS,ZTRTN,ZTSAVE,ZTDESC
17 S %ZIS="QM" D ^%ZIS G:POP ENQ1
18 I $D(IO("Q")) D G ENQ1
19 .S ZTRTN="BLD^IBCERP6",ZTDESC="IB - EDI/MRA Claims in Waiting Transmission Status"
20 .S ZTSAVE("IB*")=""
21 .D ^%ZTLOAD
22 .W !!,$S($D(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
23 .K ZTSK,IO("Q") D HOME^%ZIS
24 U IO
25 ;
26BLD ; - Tasked entry point
27 ;
28 N IBSTAT,IBILL,IBREC,IBIFN,IBSTAT,IBVSIT,IBCAT,IBI,IBINS,IBPREC,IBEVDT,IBTYP,IBPG,IBCHK
29 K ^TMP("IBCERP6",$J)
30 S (IBI,IBIFN)=0 F S IBI=$O(^IBA(364,"ASTAT","X",IBI)) Q:'IBI S IBIFN=+$G(^IBA(364,IBI,0)) D
31 .S IBQUIT=0
32 .S IBSTAT=$$WNRBILL^IBEFUNC(IBIFN)
33 .I IBSEL=2 D I IBQUIT Q
34 ..I 'IBSTAT,13[IBPARAM S IBQUIT=1 Q
35 ..I IBSTAT,23[IBPARAM S IBQUIT=1 Q
36 .S IBSTAT=$S(IBSTAT:"MRA",1:"EDI")
37 .S IBREC=$G(^DGCR(399,+IBIFN,0))
38 .S IBVSIT=$S($$INPAT^IBCEF(IBIFN,1)=1:"INP",1:"OPT")
39 .S IBCAT=$S($$FT^IBCEF(IBIFN)=3:"UB04",1:"1500")
40 .S IBILL=$$BN1^PRCAFN(IBIFN)
41 .S IBINS=$P($G(^DIC(36,+$$CURR^IBCEF2(IBIFN),0)),U)
42 .S IBPREC=$$PT^IBEFUNC(+$P(IBREC,U,2))
43 .S IBEVDT=$P($G(^DGCR(399,IBIFN,"U")),U) ;Statement from date
44 .;S IBTYP=$P(IBREC,U,24)_U_$P($G(^DGCR(399.1,+$P(IBREC,U,25),0)),U)_U_$P(IBREC,U,26)
45 .S IBTYP=$$GET1^DIQ(399,IBIFN,.24)_U_$$GET1^DIQ(399,IBIFN,.25)_U_$$GET1^DIQ(399,IBIFN,.26)
46 .S ^TMP("IBCERP6",$J,IBSTAT,IBILL)=IBILL_U_IBVSIT_U_IBCAT_U_$P(IBPREC,U)_U_$E($P(IBPREC,U,2),8,11)_U_IBEVDT_U_IBTYP_U_IBINS
47 ;
48PRINT ;Prints report
49 S (IBQUIT,IBPG,IBEDI,IBMRA,IBTOT)=0 D HDR
50 I '$D(^TMP("IBCERP6",$J)) W !!,"There are no "_$S(IBPARAM=1:"EDI",IBPARAM=2:"MRA",1:"EDI/MRA")_" records"_$S(IBSEL=2:" trapped",1:"")_" in a ready for extract status" G ENQ1
51 S IBSTAT="" F S IBSTAT=$O(^TMP("IBCERP6",$J,IBSTAT)) Q:IBSTAT=""!(IBQUIT=1) D
52 .S IBILL="" F S IBILL=$O(^TMP("IBCERP6",$J,IBSTAT,IBILL)) Q:IBILL=""!(IBQUIT=1) S IBREC=^(IBILL) D
53 ..I ($Y+5)>IOSL D I IBQUIT Q
54 ...D ASK I IBQUIT Q
55 ...D HDR
56 ..;
57 ..W !,?2,$P(IBREC,U),?15,$P(IBREC,U,2),?22,$P(IBREC,U,3)
58 ..W ?28,$E($P(IBREC,U,4),1,20),?50,$P(IBREC,U,5)
59 ..W ?57,$$FMTE^XLFDT($P(IBREC,U,6)),?73,$E($P(IBREC,U,7),1,8)_", "_$E($P(IBREC,U,8),1,3)_", "_$E($P(IBREC,U,9),1,16),?110,$E($P(IBREC,U,10),1,20)
60 ..I IBSTAT="EDI" S IBEDI=IBEDI+1
61 ..E S IBMRA=IBMRA+1
62 ..S IBTOT=IBTOT+1
63 W !!
64 I IBEDI>0 W !,?3,"Total EDI Bills ",IBEDI
65 I IBMRA>0 W !,?3,"Total MRA Bills ",IBMRA
66 W !!,?3,"Total bills ",IBTOT
67 K ^TMP("IBCERP6",$J)
68 I $D(ZTQUEUED) S ZTREQ="@"
69 I '$D(ZTQUEUED) D ^%ZISC
70ENQ1 K IBPARAM,IBQUIT,IBSEL,Y,IBEDI,IBMRA,IBTOT Q
71 ;
72PARAM ;
73 S IBPARAM=$P($G(^IBE(350.9,1,8)),U,10) ;Get MRA/EDI site parameter setting
74 I IBPARAM="" D
75 .W !!,"Your EDI/MRA site parameter setting is incomplete."
76 .W !,"Please contact your coordinator.",!
77 .S IBQUIT=1
78 ;
79 I IBSEL=2,IBPARAM=3 D
80 .W !!,"Your site parameters are set to allow both EDI and MRA"
81 .W !,"transmissions. There is no need to run this report.",!
82 .S IBQUIT=1
83 Q
84 ;
85HDR ;Prints report heading
86 ; IB*2.0*211
87 ;I $E(IOST,1,2)="C-" W @IOF,*13
88 I $S(IBPG:1,1:$E(IOST,1,2)="C-") W @IOF,*13
89 S IBPG=IBPG+1
90 W !!,?45,$S(IBSEL=2:"Trapped ",1:"")_" Claims Ready for Extract",?90,$$FMTE^XLFDT(DT),?110,"Page: ",IBPG
91 W !!,?15,"Inpt/",?23,"Inst/",!,?4,"Bill #",?15,"Opt",?23,"Prof",?32,"Name"
92 W ?51,"SSN",?57,"Statement Date",?89,"Type",?110,"Insurance Co."
93 W !,$TR($J("",IOM)," ","=")
94 Q
95 ;
96ASK ;
97 I $E(IOST,1,2)'["C-" Q
98 N DIR,DIROUT,DIRUT,DTOUT,DUOUT
99 S DIR(0)="E" D ^DIR
100 I ($D(DIRUT))!($D(DUOUT)) S IBQUIT=1 Q
101 Q
102 ;
103SELECT ;Report selection
104 N DIR,DIROUT,DTOUT,DUOUT,DTOUT
105 S IBSEL=0
106 W !! S DIR("A",1)="Do you want to print a list of:"
107 S DIR("A",2)=""
108 S DIR("A",3)=" 1 - All bills in Ready for Extract status"
109 S DIR("A",4)=" 2 - Bills trapped due to EDI/MRA parameter being turned off"
110 S DIR("A",5)=""
111 S DIR(0)="SAXB^1:All bills;2:Trapped bills"
112 W !
113 S DIR("A")="Select Number: ",DIR("B")=1
114 D ^DIR
115 I +Y'>0 S IBQUIT=1 Q
116 S IBSEL=+Y
117 Q
Note: See TracBrowser for help on using the repository browser.