source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCNQ.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 4.7 KB
Line 
1IBCNQ ;ALB/MJB - MCCR PATIENT BILLING INQUIRY ;13 JUN 88 13:52
2 ;;2.0;INTEGRATED BILLING;**51,320,377**;21-MAR-94;Build 23
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ;MAP TO DGCRNQ
6 ;
7 D HOME^%ZIS
8ASKPAT S DIC="^DGCR(399,",DIC(0)="AEMQZ",DIC("A")="Enter BILL NUMBER or PATIENT NAME: " W !! D ^DIC G:X=""!(X["^") Q
9 ;
10 S IBIFN=+Y,IBQUIT=0,IBAC=7
11VIEW ;
12 ;***
13 F I=0,"S","U","U1" S IB(I)=$G(^DGCR(399,IBIFN,I))
14 S DFN=$P(IB(0),"^",2),IBSTAT=$P(IB(0),"^",13),IBBNO=$$BN^PRCAFN(IBIFN),IBPAGE=0 S:IBBNO=-1 IBBNO=$S($D(IBIL):IBIL,1:$P(IB(0),"^"))
15 ;
16 D NOW^%DTC S Y=$E(%,1,12) D D^DIQ S IBNOW=Y,IBPT=$$PT^IBEFUNC(DFN) D HDR1
17 ;
18 S IBUN="UNSPECIFIED",IBUK="UNKNOWN USER"
19 W !,"Bill Status",?15,": ",$S(IBSTAT=1:"ENTERED/NOT REVIEWED",IBSTAT=2:"MRA REQUESTED",IBSTAT=3:"AUTHORIZED",IBSTAT=4:"PRINTED/TRANSMITTED",IBSTAT=7:"CANCELLED",1:IBUN)," - RECORD IS ",$S(IBSTAT=1:"",1:"UN"),"EDITABLE"
20 W !,"Rate Type",?15,": ",$S($P(IB(0),"^",7)="":IBUN,'$D(^DGCR(399.3,$P(IB(0),"^",7),0)):IBUN,1:$P(^DGCR(399.3,$P(IB(0),"^",7),0),"^"))
21 W:+$P(^IBE(350.9,1,1),"^",22) !,"Form Type",?15,": ",$S($P($G(^IBE(353,+$P(IB(0),"^",19),0)),"^")]"":$P(^(0),"^"),1:IBUN)
22 W:IBSTAT=7 !,"Reason Canceled",?15,": ",$S($P(IB("S"),"^",19)]"":$P(IB("S"),"^",19),1:IBUN)
23 I $$INPAT^IBCEF(IBIFN) S Y=$P(IB(0),"^",3) D D^DIQ W !!,"Admission Date : ",Y
24 E D OPDATE
25 W !!,"Charges",?15,": " S X=$P(IB("U1"),U,1),X2="2$" D:X]"" COMMA^%DTC W $S(X]"":X,1:IBUN)
26 I $P(IB("U1"),U,2)]"" W !,"LESS Offset",?15,": " S X=$P(IB("U1"),U,2),X2="2$" D COMMA^%DTC W X," [",$P(IB("U1"),U,3),"]",!,"Bill Total",?15,": " S X=($P(IB("U1"),U,1)-$P(IB("U1"),U,2)),X2="2$" D COMMA^%DTC W X
27 S X=$$TPR^PRCAFN(IBIFN) I X>0 S X2="2$" D COMMA^%DTC W !,"Amount Paid",?15,": ",X
28 S X=$$STA^PRCAFN(IBIFN) I X>0 W !,"AR Status",?15,": ",$P(X,"^",2)
29 I $P(IB("U"),U)]"" S Y=$P(IB("U"),U) D D^DIQ W !!,"Statement From",?15,": ",Y S Y=$P(IB("U"),"^",2) D D^DIQ W !,"Statement To",?15,": ",Y,!
30 I $P(IB("U"),U)']"" W !!,"Statement From",?15,": ",IBUN,!,"Statement To",?15,": ",IBUN,!
31 D DISP I IBQUIT Q:IBAC[8 G Q
32 I IBSTAT<5 D NOPTF^IBCB2 I 'IBAC1 D:$Y>(IOSL-6) HDR Q:IBQUIT&(IBAC[8) G Q:IBQUIT D NOPTF1^IBCB2
33 D PAUSE,^IBOLK1:$G(IBFULL)&('IBQUIT) Q:IBAC[8 ; Called from Outpatient Visit Date Inquiry
34 G Q:IBQUIT,ASKPAT
35 ;
36DISP ; The variable IBAC must be defined as input to this sub-routine.
37 G:'$D(IBAC) DISPQ
38 S IBUN="UNSPECIFIED",IBUK="UNKNOWN USER"
39 I IB("S")']"" W !,"Past actions of this billing record unspecified." G DISPQ
40 S IBX="Entered^^^^^^MRA Requested^^^Authorized^^First Printed^^Last Printed^^^Cancelled"
41 F I=1,7,10,12,14,17 I $P(IB("S"),U,I)]"" D:IBAC[7&($Y>(IOSL-4)) HDR Q:$S(IBAC'[7:0,1:IBQUIT) D DISP1
42 ;
43 ;Patch 320 - Added call to retrieve claim clone history.
44 N IBCCR,IBCURR,IBNEXT,IBBCH,IBINDENT
45 S IBINDENT=0
46 D EN^IBCCR(IBIFN,.IBCCR) ; utility to pull cloning history
47 ;
48 ; attempt to go one claim forward from the current claim
49 S IBCURR="IBCCR("_+$P(IB("S"),U,1)_","_IBIFN_")"
50 S IBNEXT=$Q(@IBCURR)
51 I IBNEXT'="" D
52 . N IBX S IBX=@IBNEXT
53 . W !,"Copied"
54 . W ?15,": ",$$FMTE^XLFDT($P(IBX,U,1),"1Z")_" by "_$P(IBX,U,3)
55 . W !,"Copied To",?15,": ",$P(IBX,U,2)
56 . S IBINDENT=1
57 . Q
58 ;
59 ; now go backwards for claim cloning history all the way back
60 S IBBCH=IBCURR
61 F S IBBCH=$Q(@IBBCH,-1) Q:IBBCH="" D
62 . N IBX,TS1,TS2 S IBX=@IBBCH
63 . I IBINDENT S TS1=4,TS2=19 ; set tab stops
64 . E S TS1=0,TS2=15
65 . W !?TS1,"Copied",?TS2,": "
66 . W $$FMTE^XLFDT($P(IBX,U,1),"1Z")_" by "_$P(IBX,U,3)
67 . W !?TS1,"Copied From",?TS2,": ",$P(IBX,U,2)
68 . W !?TS1,"Reason Copied",?TS2,": ",$P(IBX,U,4)
69 . S IBINDENT=1
70 . Q
71 ;
72 I $D(^DGCR(399,IBIFN,"R","AC",1)) S IB=0 F I=0:0 S IB=$O(^DGCR(399,IBIFN,"R","AC",1,IB)) Q:'IB D:IBAC[7&($Y>(IOSL-4)) HDR Q:$S(IBAC'[7:0,1:IBQUIT) W !,"Returned to AR : " D RETN
73DISPQ Q
74 ;
75DISP1 W !,$P(IBX,U,I) S Y=$P(IB("S"),U,I) D D^DIQ W ?15,": ",Y,?28," by " S IBN=$P(IB("S"),U,(I+1)) W $S(IBN']"":IBUK,$D(^VA(200,IBN,0)):$P(^(0),U,1),1:IBUK)
76 Q
77 ;
78Q K DFN,IB,IBAC,IBBNO,IBN,IBNOW,IBPAGE,IBPT,IBU,IBQUIT,IBUK,IBUN,IBX,IBSTAT,IBAC1,IBIFN,IBOPD,DIC,X,X2,Y
79 Q
80 ;
81RETN I $D(^DGCR(399,IBIFN,"R",IB,0)) S IBN=^(0),Y=$P($P(IBN,"^"),".") D D^DIQ W Y,?28," by " S IBN=$P(IBN,"^",2) I IBN]"",$D(^VA(200,IBN,0)) W $P(^VA(200,IBN,0),"^")
82 Q
83 ;
84HDR D PAUSE Q:IBQUIT
85HDR1 S L="",$P(L,"=",80)="",IBPAGE=IBPAGE+1
86 W:$E(IOST,1,2)["C-"!(IBPAGE>1) @IOF
87 W $E($P(IBPT,"^"),1,20)," ",$P(IBPT,"^",2),?38,IBBNO,?51,IBNOW,?72,"PAGE: ",IBPAGE,!,L
88 K L Q
89 ;
90OPDATE ; List Outpatient Visit Dates.
91 Q:'$O(^DGCR(399,IBIFN,"OP",0))
92 W !!,"OP Visit Dates :" S IBOPD=0
93 F I=1:1 S IBOPD=$O(^DGCR(399,IBIFN,"OP",IBOPD)) Q:'IBOPD D
94 . W:'((I-1)#4)&(I>1) !
95 . S Y=IBOPD D D^DIQ W ?($S(I#4:I#4,1:4)*14+3),Y
96 Q
97 ;
98PAUSE Q:$E(IOST,1,2)'="C-"
99 F I=$Y:1:(IOSL-3) W !
100 S DIR(0)="E" D ^DIR K DIR I $D(DIRUT)!($D(DUOUT)) S IBQUIT=1 K DIRUT,DTOUT,DUOUT
101 Q
Note: See TracBrowser for help on using the repository browser.