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

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1IBCF ;ALB/RLW - task 1500/UB printing ;12-JUN-92
2 ;;2.0;INTEGRATED BILLING;**33,63,52,121,51,137,349**;21-MAR-94;Build 46
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5EN1 ; call appropriate print routine for the claim form type to be printed
6 K IBRESUB
7 ;
8EN1X ; Entrypoint for reprint (IBRESUB will be defined)
9 N IBF,IB,IBFORM,IBJ
10 S IB=$$FT^IBCU3(IBIFN) ; form type ien (2 or 3)
11 S IBFT=$$FTN^IBCU3(IB) ; form type name
12 S IBF=$P($G(^IBE(353,+IB,2)),U,8)
13 S:IBF="" IBF=IB ;Forces the use of the output formatter to print bills
14 D ENFMT(IBIFN,IB,IBF,,$G(IBRESUB))
15END K IBFT,IBRESUB
16 Q
17 ;
18EN2 ; send to default A/R device
19 S ZTDTH=$H,IBIFN=PRCASV("ARREC"),IBPNT=PRCASV("NOTICE")
20 D FORM S (IBFORM1,ZTDESC)="FOLLOW-UP AR FORM "_$P($G(^IBE(353,+IBFT,0)),"^")
21 D QUEUE
22 Q
23 ;
24EN3 ;queue an Rx Addendum for a bill, IBIFN must be defined
25 Q:'$D(^DGCR(399,+$G(IBIFN),0)) I '$D(^IBA(362.4,"AIFN"_+IBIFN)),'$D(^IBA(362.5,"AIFN"_+IBIFN)) Q
26 N IBFT S IBFT=$$FNT^IBCU3("BILL ADDENDUM") Q:'IBFT S (IBFORM1,ZTDESC)="BILL ADDENDUM FOR "_$P(^DGCR(399,+IBIFN,0),U,1)
27 S ZTSAVE("IB*")="",ZTDTH=$H
28 S ZTIO=$P($G(^IBE(353,IBFT,0)),"^",2),ZTRTN=$G(^IBE(353,IBFT,1)) I (ZTIO="")!(ZTRTN="") K ZTDESC,ZTSAVE,ZTDTH,ZTIO,ZTRTN Q
29 D ^%ZTLOAD
30 Q
31 ;
32EN4 ;queue bills, IBIFN must be defined
33 S ZTDTH=$H,IBPNT=1 Q:'$D(^DGCR(399,+$G(IBIFN),0))
34 D FORM
35 S IBF=$P($G(^IBE(353,+IBFT,2)),U,8)
36 I $P($G(^IBE(353,+IBFT,0)),U,2)="",IBF="" Q
37 S (IBFORM1,ZTDESC)=$P($G(^IBE(353,+IBFT,0)),"^")_" BILL "_$P(^DGCR(399,+IBIFN,0),U,1)
38 S ZTSAVE("IB*")=""
39 S ZTIO=$P($G(^IBE(353,IBFT,0)),"^",2),ZTRTN=$S(IBF="":$G(^IBE(353,IBFT,1)),1:"ENFMT^IBCF(IBIFN,IBFT,IBF,ZTIO,$G(IBRESUB))")
40 I (ZTIO="")!(ZTRTN="") S IBAR("ERR")="BILL FORM TYPE NOT COMPLETE FOR"_IBFORM1 Q
41 D ^%ZTLOAD I '$D(ZTSK) S IBAR("ERR")="QUEUEING OF "_IBFORM1_" FAILED",IBAR("OKAY")=0 W IBAR("ERR") Q
42 S IBAR("OKAY")=1
43 Q
44 ;
45EN5 ;queue 1500 Rx Addendum to Follow-up (AR) printer, IBIFN must be defined - no longer used
46 Q:'$D(^DGCR(399,+$G(IBIFN),0)) I '$D(^IBA(362.4,"AIFN"_+IBIFN)),'$D(^IBA(362.5,"AIFN"_+IBIFN)) Q
47 Q:$$FT^IBCU3(IBIFN)'=2
48 N IBFT S IBFT=$$FNT^IBCU3("BILL ADDENDUM") Q:'IBFT S (IBFORM1,ZTDESC)="BILL ADDENDUM FOR "_$P(^DGCR(399,+IBIFN,0),U,1)
49 S ZTSAVE("IB*")="",ZTDTH=$H
50 S ZTIO=$P($G(^IBE(353,IBFT,0)),"^",3),ZTRTN=$G(^IBE(353,IBFT,1)) I (ZTIO="")!(ZTRTN="") K ZTDESC,ZTSAVE,ZTDTH,ZTIO,ZTRTN Q
51 D ^%ZTLOAD
52 Q
53 ;
54ENFMT(IBIFN,IB,IBF,ZTIO,IBRESUB) ; Use formatter to print bill IBIFN
55 N IBFT,IBFTP,IBFORM,IBJ
56 S (IBFT,IBFORM)=IB,IBFTP="IBCFP"_IB,IBJ=$J
57 K ^XTMP(IBFTP,$J),^TMP("IBQONE",$J)
58 S ^XTMP(IBFTP,$J,1,1,1,IBIFN)="",^TMP("IBQONE",$J)=""
59 D FORM^IBCEFG7(IBF,$G(ZTIO))
60 I $G(IBRESUB) D
61 . N IBDA
62 . S IBDA=$$LAST364^IBCEF4(IBIFN)
63 . I IBDA D UPDEDI^IBCEM(IBDA,"P")
64 K ^TMP("IBQONE",$J)
65 I IBFT'=3 D EN3
66 Q
67 ;
68FORM ;
69 S IBFT=$$FT^IBCU3(IBIFN)
70 Q
71QUEUE ;
72 S IBF=$P($G(^IBE(353,+IBFT,2)),U,8)
73 S ZTSAVE("IB*")=""
74 S ZTIO=$P($G(^IBE(353,IBFT,0)),"^",3),ZTRTN=$S(IBF="":$G(^IBE(353,IBFT,1)),1:"ENFMT^IBCF(IBIFN,IBFT,IBF,ZTIO,$G(IBRESUB))")
75 I ((ZTIO="")&(IBF=""))!(ZTRTN="") S IBAR("ERR")="BILL FORM TYPE NOT COMPLETE FOR"_IBFORM1 Q
76 D ^%ZTLOAD I '$D(ZTSK) S IBAR("ERR")="QUEUEING OF "_IBFORM1_" FAILED",IBAR("OKAY")=0 W IBAR("ERR") Q
77 S IBAR("OKAY")=1
78 Q
79 ;
80DISPX ; call to exclude transmittable bills
81 D DISP1(1)
82 Q
83 ;
84DISP ; call to include all bills
85 D DISP1(0)
86 Q
87 ;
88DISP1(IBTX) ;print list of authorized bills - exclude transmittables if
89 ; IBTX=1
90 N IBIFN,IBC,Y
91 S IBIFN=0,IBC=0,Y="" W !
92 F S IBIFN=$O(^DGCR(399,"AST",3,IBIFN)) Q:'IBIFN S IBX=$G(^DGCR(399,IBIFN,0)) I IBX'="" D Q:Y="^"
93 . I $G(IBTX) D Q:IBX=""
94 .. N Z
95 .. S Z=0 F S Z=$O(^IBA(364,"B",IBIFN,Z)) Q:'Z I $D(^IBA(364,"ASTAT","X",Z)) S IBX="" Q
96 . W !,$P(IBX,U,1),?10,$E($P($G(^DPT(+$P(IBX,U,2),0)),U,1),1,20),?32,$$DATE^IBCFP(+$P(IBX,U,3)),?42,$S(+$P(IBX,U,5)<3:"INPT",1:"OUTPT")
97 . W ?49,$P($G(^DGCR(399.3,+$P(IBX,U,7),0)),U,4),?59,$E($$EXSET^IBEFUNC(+$P(IBX,U,13),399,.13),1,7),?68,$E($$FTN^IBCU3($$FT^IBCU3(IBIFN)),1,11)
98 . S IBC=IBC+1 I '(IBC#10) R !,"Press RETURN to continue or '^' to exit: ",Y:DTIME
99 Q
100 ;
101DISPT ;print list of all bills awaiting transmission
102 N IBI,IBIFN,IBC,Y S (IBC,IBI)=0,Y="" W !
103 F S IBI=$O(^IBA(364,"ASTAT","X",IBI)) Q:'IBI S IBIFN=+$G(^IBA(364,+IBI,0)),IBX=$G(^DGCR(399,IBIFN,0)) I IBX'="" D Q:Y="^"
104 . W !,$P(IBX,U,1),?10,$E($P($G(^DPT(+$P(IBX,U,2),0)),U,1),1,20),?32,$$DATE^IBCFP(+$P(IBX,U,3)),?42,$S(+$P(IBX,U,5)<3:"INPT",1:"OUTPT")
105 . W ?49,$P($G(^DGCR(399.3,+$P(IBX,U,7),0)),U,4),?59,$E($$EXSET^IBEFUNC(+$P(IBX,U,13),399,.13),1,7),?68,$E($$FTN^IBCU3($$FT^IBCU3(IBIFN)),1,11)
106 . S IBC=IBC+1 I '(IBC#10) R !,"Press RETURN to continue or '^' to exit: ",Y:DTIME
107 Q
108 ;
Note: See TracBrowser for help on using the repository browser.