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

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

revised back to 6/30/08 version

File size: 4.0 KB
Line 
1IBCE ;ALB/TMP - 837 EDI TRANSMISSION UTILITIES/NIGHTLY JOB ;22-JAN-96
2 ;;2.0;INTEGRATED BILLING;**137,283,296**;21-MAR-94
3EN ; Run all jobs needed for EDI processing nightly
4 ; including transmit bills waiting for extract, batches not sent,
5 N IBLAST,IBZ,IBZ0
6 D NOTSENT^IBCEBUL
7 D EN^IBCE837
8 D EN^IBCEMPRG ; purge status messages from file 361
9 D PURGE^IBCEPTU ; purge transmission detail and claims status data associated with test transmissions after 60 days
10 S IBLAST=$G(^IBA(364.2,"ALAST")),^IBA(364.2,"ALAST")=$$NOW^XLFDT()
11 ; Clean up ACOB xref in 364
12 S IBZ=0
13 F S IBZ=$O(^IBA(364,"ACOB",IBZ)) Q:'IBZ S IBZ0=0 F S IBZ0=$O(^IBA(364,"ACOB",IBZ,IBZ0)) Q:'IBZ0 I '$$COBPOSS^IBCECOB(IBZ0) D UPDEDI^IBCEM(IBZ0,"N",1)
14 Q
15 ;
16EN1 ; Manual entry point for transmitting EDI bills
17 N DIR,X,Y,IBLAST,IBTASK,IBOPTX,DTOUT,DUOUT
18 I '$$MGCHK(1) G EN1Q
19 S DIR("A")="Select transmit option: ",DIR("B")="S",DIR(0)="SAM^A:Transmit (A)LL bills in READY FOR EXTRACT status;S:Transmit only (S)ELECTED bills"
20 D ^DIR K DIR
21 I $D(DTOUT)!$D(DUOUT) G EN1Q
22 S IBOPTX=Y
23 I Y="A" D G EN1Q
24 . S DIR("A",1)="This option will run a job to transmit ALL bills ready for EDI transmission"
25 . S DIR("A",2)="This option's last scheduled run was "_$$FMTE^XLFDT($G(^IBA(364.2,"ALAST")),2)
26 . S DIR("A",3)=" "
27 . S DIR("A")="Are you absolutely sure this is what you want to do? "
28 . S DIR("B")="NO",DIR(0)="YA" D ^DIR K DIR
29 . Q:'Y
30 . S DIR(0)="YA",DIR("A",1)=" "
31 . S DIR("A",2)="Transmission of ALL bills will be run now"
32 . S DIR("A")="Is this OK? ",DIR("B")="NO"
33 . D ^DIR K DIR
34 . Q:'Y
35 . D EN1^IBCE837B(.IBTASK)
36 . I $G(IBTASK) D
37 .. S DIR("A",1)="Task # for this job is: "_IBTASK
38 . E D
39 .. I $G(IBTASK)'="" S DIR("A",1)="Error encountered in tasking job - check IRM for reported errors"
40 .. S DIR(0)="EA",DIR("A")=" Press RETURN to continue " W !! D ^DIR K DIR
41 I IBOPTX="S" D SUB1^IBCEM03 G EN1Q
42EN1Q Q
43 ;
44RESUB(IB364) ; Manually resubmit bill for transmission (ien file 364 = IB364)
45 N DIR,X,Y,IBBTCH,DTOUT,DUOUT
46 I '$$MGCHK(1) G RESUBQ
47 S IBBTCH=""
48 W ! S DIR(0)="SA^I:IMMEDIATE TRANSMIT;L:TRANSMIT LATER WITH REST OF READY FOR EXTRACT BILLS",DIR("A")="TRANSMIT (I)MMEDIATELY OR (L)ATER?: ",DIR("B")="L"
49 S DIR("?",1)="IF YOU CHOOSE TO TRANSMIT IMMEDIATELY, THE BILL'S DATA WILL BE BATCHED BY",DIR("?",2)=" ITSELF AND SENT OUT IMMEDIATELY. IF YOU CHOOSE TO TRANSMIT LATER, THE"
50 S DIR("?",3)=" BILL'S TRANSMISSION STATUS WILL BE RESET TO 'READY FOR EXTRACT' AND THE BILL'S",DIR("?",4)=" DATA WILL BE EXTRACTED THE NEXT TIME A GENERAL TRANSMISSION OF YOUR BILLS",DIR("?")=" IN READY TO EXTRACT STATUS OCCURS"
51 D ^DIR K DIR
52 I $D(DTOUT)!$D(DUOUT) G RESUBQ
53 I Y="I" D G:'IBBTCH RESUBQ
54 . N Y
55 . K ^TMP("IBONE",$J),^TMP("IBSELX",$J),^TMP("IBCE-BATCH",$J)
56 . S ^TMP("IBONE",$J,IB364)="",^TMP("IBONE",$J)=0,^TMP("IBSELX",$J)=""
57 . D ONE^IBCE837
58 . S IBBTCH=$O(^TMP("IBCE-BATCH",$J,0)) ; external batch#
59 . I IBBTCH'="" S IBBTCH=+$G(^TMP("IBCE-BATCH",$J,IBBTCH)) ; internal batch#
60 . K ^TMP("IBONE",$J),^TMP("IBSELX",$J),^TMP("IBCE-BATCH",$J)
61 . I 'IBBTCH D
62 .. S DIR("A",1)="BILL NOT RESUBMITTED - CHECK ALERTS/MAIL FOR DETAILS"
63 . E D
64 .. N DIE,DR,DA
65 .. D UPDEDI^IBCEM(IB364,"R")
66 .. S DIE="^IBA(364,",DR=".06////"_+IBBTCH,DA=IB364 D ^DIE
67 .. S DIR("A",1)="BILL RESUBMITTED IN BATCH #"_$P($G(^IBA(364.1,IBBTCH,0)),U)
68 . S DIR(0)="EA",DIR("A")="PRESS ENTER TO CONTINUE " D ^DIR K DIR
69 I Y="L" D
70 . N Y
71 . D UPDEDI^IBCEM(IB364,"R")
72 . ;Add a new transmission record
73 . S Y=$$ADDTBILL^IBCB1($P($G(^IBA(364,+IB364,0)),U),1)
74 . S DIR("A",1)="BILL'S TRANSMISSION STATUS RESET TO 'READY TO EXTRACT'"
75 . S DIR(0)="EA",DIR("A")="PRESS ENTER TO CONTINUE " D ^DIR K DIR
76 ;
77RESUBQ Q
78 ;
79MGCHK(DSP) ; Returns 1 if mail group IB EDI has at least 1 local member,
80 ; 0 if none found
81 ; DSP = flag that if =1, displays error message
82 N IB
83 S IB=$$GOTLOCAL^XMXAPIG("IB EDI")
84 I 'IB,$G(DSP) D
85 . ; No local members in mail group for EDI messages
86 . S DIR("A",1)="YOU MUST HAVE AT LEAST 1 MEMBER IN THE 'IB EDI' MAIL GROUP TO TRANSMIT A BILL",DIR("A")="PRESS RETURN TO CONTINUE "
87 . S DIR(0)="EA" D ^DIR K DIR
88 Q IB
89 ;
Note: See TracBrowser for help on using the repository browser.