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

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1IBCERP4 ;ALB/TMP - EDI RECEIPT/REJECTION MSGS STILL PENDING/UPDATNG ; 4/22/03 8:29am
2 ;;2.0;INTEGRATED BILLING;**137,211**;21-MAR-94
3 Q
4PENDING ; Report of EDI messages still waiting to be filed
5 ; after a user-specified # of days.
6 N DIR,IBDAYS
7 W !!
8 S DIR(0)="NA^1:999",DIR("B")=1,DIR("A")="MINIMUM # OF DAYS MSGS WAITING TO BE FILED: ",DIR("?",1)="Enter the minimum number of days a message has been waiting to be filed",DIR("?")="before it appears on this report" D ^DIR K DIR
9 Q:$D(DTOUT)!$D(DUOUT)
10 S IBDAYS=+Y
11 S %ZIS="QM" D ^%ZIS Q:POP
12 I $D(IO("Q")) K IO("Q") S ZTSAVE("IB*")="",ZTRTN="EN^IBCERP4",ZTDESC="REPORT OF EDI MSGS PENDING TOO LONG TO BE FILED" D ^%ZTLOAD K ZTSK D HOME^%ZIS Q
13 U IO
14EN ; Queued job entrypoint
15 N IBPAGE,IBHDRDT,IBLINE,IBSTOP,IBDA,IBCT,IBM,IBMSG,IB0,IB1,IB,DIR,Y
16 ;
17 K ^TMP($J,"IBSORT")
18 S IBDA=0 F S IBDA=$O(^IBA(364.2,IBDA)) Q:'IBDA S IB0=$G(^IBA(364.2,IBDA,0)),IB1=$G(^(1)),IBM=+$P(IB0,U,2) D
19 .; IB*2.0*211 - kill off records with dangling nodes
20 . I IB0="",IB1'="" N DA,DIK,Y S DA=IBDA,DIK="^IBA(364.2," D ^DIK Q
21 . I DT-($P(IB1,U,3)\1)'<IBDAYS,'$P(IB0,U,12) D
22 .. S ^TMP($J,"IBSORT",$P(IB0,U),IBDA)=$P(IB0,U)_U_$P(IB0,U,6)_U_$P(IB1,U,3)_U_$P(IB0,U,4,5),$P(^(IBDA),U,6)=IBM
23 ;
24 W:$E(IOST,1,2)["C-" @IOF ;Only initial form feed for print to screen
25 ;
26 S (IBPAGE,IBSTOP,IBCT,IBMSG,IBLINE)=0
27 D HDR1
28 I '$D(^TMP($J,"IBSORT")) W !,"No data found for this report",!
29 F S IBMSG=$O(^TMP($J,"IBSORT",IBMSG)) Q:'IBMSG!(IBSTOP) S IBDA=0 F S IBDA=$O(^TMP($J,"IBSORT",IBMSG,IBDA)) Q:'IBDA S IBV=$G(^(IBDA)) D Q:IBSTOP
30 . D:IBLINE>(IOSL-5) HDR1 Q:IBSTOP
31 . W !,?2,$P($G(^IBE(364.3,+$P(IBV,U,6),0)),U,5)
32 . W !,?4,$P(IBV,U),?15,$$EXPAND^IBTRE(364.2,.06,$P(IBV,U,2)),?31,$$FMTE^XLFDT($P(IBV,U,3),1),?54,$$EXPAND^IBTRE(364.2,.04,$P(IBV,U,4))
33 . S Z=$$BN1^PRCAFN(+$G(^IBA(364,+$P(IBV,U,5),0)))
34 . I Z'=-1 W ?65,Z
35 . S IBCT=IBCT+1,IBLINE=IBLINE+1
36 ;
37 W !!,"TOTAL # OF MESSAGES WAITING OVER "_IBDAYS_" DAY"_$S(IBDAYS>1:"S",1:"")_" TO BE FILED: ",IBCT
38 ;
39 I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR
40STOP I '$D(ZTQUEUED) D ^%ZISC
41 I $D(ZTQUEUED) S ZTREQ="@"
42 K ^TMP($J,"IBSORT")
43 Q
44 ;
45HDR1 ; Report header
46 ;IB = the text for the type of batch
47 N Z,DIR,Y
48 I 'IBPAGE S IBHDRDT=$$HTE^XLFDT($H,"2")
49 I IBPAGE D Q:IBSTOP
50 . I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR S IBSTOP=('Y) Q:IBSTOP
51 . W @IOF
52 ;
53 S IBPAGE=IBPAGE+1,Z="EDI MESSAGES WAITING TO BE FILED OVER "_IBDAYS_" DAY"_$S(IBDAYS>1:"S",1:"")
54 W !,?((80-$L(Z))\2),Z,?70,"PAGE: ",IBPAGE,!
55 W !,?26,"RUN DATE: ",IBHDRDT,!
56 W !,?2,"MESSAGE TYPE"
57 W !,?4,"MAIL",?31,"IN CURRENT",!,?4,"MESSAGE #",?15,"CURRENT STATUS",?31,"STATUS SINCE",?54,"BATCH #",?65,"BILL #",!
58 S Z="",$P(Z,"-",76)="" W ?2,Z,!
59 S IBLINE=7
60 Q
61 ;
Note: See TracBrowser for help on using the repository browser.