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

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

initial load of WorldVistAEHR

File size: 4.3 KB
RevLine 
[613]1IBCOPV1 ;ALB/LDB - CPT LISTING IN MCCR ;30 APR 90
2 ;;2.0;INTEGRATED BILLING;**106,260**;21-MAR-94
3 ;
4 ;MAP TO DGCROPV1
5 ;
6PRT ;
7 N IBQUIT,IBNUM,IBDATE,Z1 S IBQUIT=0
8 ;D:$D(DIR) HLP
9 D HDR1,HDR F I=0:0 S I=$O(^UTILITY($J,"OPV","AP",I)) Q:'I S IBNUM=I-1 W ! D SCR Q:IBQUIT S IBNUM=I W ?1,I_")",?5 S (Y,I1)=+^UTILITY($J,"OPV","AP",I) D DT^DIQ S IBDATE=Y K Y D VT Q:IBQUIT
10 ;W:DGCNT>30 !!,"THERE ARE MORE THAN TEN VISITS DURING THE PERIOD THAT THIS STATEMENT COVERS."
11 F C=$Y:1:(IOSL-6) W !
12 D:'IBQUIT PICK
13 G Q2
14 ;Q:$D(DIR)
15PICK K Y S DIR("A")="Select visits to include in this bill (1-"_IBNUM_"): "
16OK S DIR(0)="LAO^1:"_IBNUM_"^K:X[""."" X" D ^DIR
17 I $D(DTOUT)!$D(DUOUT) S IBQUIT=1 Q
18 Q:X=""
19 I $P($$OPV1^IBCU41(IBIFN,1,($L(Y,",")-1)),U,2)'="" G OK
20 ;I (DGCNT1+($L(Y,",")-1))>30 W !,"Maximum of 30 visits allowed per bill!",!,"The visits already on the bill along with those selected total more than 30." G OK
21 ;I $D(^DIC(36,+^DGCR(399,IBIFN,"M"),0)),$P(^(0),"^",8),+$P(Y,",",2)>0!(DGCNT1&(+$E(Y)>0)) W !,*7,"THIS INSURANCE COMPANY WILL ONLY ACCEPT ONE VISIT PER BILL.",! G OK
22OK1 I +Y W !,"YOU HAVE SELECTED VISIT(S) NUMBERED- ",$E(Y,1,$L(Y)-1),!,"IS THIS CORRECT" S %=1 D YN^DICN I %=-1 S IBOUT=1 G Q2
23 I +Y,'% W !,"Enter 'Y'es to include these visits.",!,"Enter 'N'o to reselect." G OK1
24 I +Y,%=2 G OK
25 G:'Y Q1
26 S IBVT=Y
27 F I=1:1 S:$P(IBVT,",",I) DGAP=$P(IBVT,",",I) Q:$P(IBVT,",",I)']"" D VFILE
28 D Q2 Q
29VFILE S (DINUM,X)=+^UTILITY($J,"OPV","AP",DGAP)
30VFILE1 S DA(1)=IBIFN,DIC(0)="L",DIC="^DGCR(399,"_DA(1)_",""OP"","
31 S:'$D(^DGCR(399,DA(1),"OP",0)) ^(0)="^399.043DA^"
32 I $D(^DGCR(399,DA(1),"OP",DINUM)) G VFILEQ
33 I '$$OPV1^IBCU41(IBIFN,1)!('$$OPV2^IBCU41(DINUM,IBIFN,1)) D S DGNOADD=1 G VFILEQ
34 . W !,?10,"Can't add OP Visit Date of ",$$DAT2^IBOUTL(X)
35 S Y=$$DUPCHK^IBCU41(DINUM,IBIFN,1)
36 ;I $P(^DGCR(399,IBIFN,0),"^",19)'=2,$O(^DGCR(399,DA(1),"OP",0)),$D(^DGCR(399,"ASC2",DA(1))) W !?4,"Only 1 visit date allowed on bills with Amb. Surg. Codes!" S DGNOADD=1 G VFILEQ
37 W !?4,"Adding OP Visit Date of ",$$DAT2^IBOUTL(X)
38 K DD,DO D FILE^DICN L ^DGCR(399,IBIFN):1
39VFILEQ Q
40Q2 S IBQUIT=1 K DIR,DIRUT G Q
41Q1 S:$D(DUOUT)!$D(DTOUT) IBOUT=1 K DIR,DIRUT
42Q K DA,DGBIL,DGCNT,DGCNT2,DGCOD,DGCT1,IBCD,DGCPT,DGCPT1,IBOPV,IBCOPV1,IBOPV2,IBOPV3,IBOPV4,DGCNT1,DGCNT2,DGDT,DGDT,DGDT1,DGFIL,DGMT,DGMT1,DGNO,DGNOD,DGTYP,DGTYPE,DIC,DIE,DINUM,DR,L,V,X,Y,IBCHG1,IBCHG2,IBRVCE,IBVDT
43 K DGTE,I9,DGLP,DGCPT0,DGCPT2,DGCPT3,I7,P,IBVT,DGAP,Z,I4,DGASC,DGCPTS,DGBIL1,DGDIV,DGDAT,DGNOADD,IBFT,IBCODCL Q
44 ;
45HDR1 W @IOF,?25,"<<<OUTPATIENT VISITS>>>",!! S X="",$P(X,"=",80)="" W X Q
46HDR W !,"NO.",?6,"VISIT DATE",?19,"ELIG/MT",?28,"PROVIDER",?45,"BILL# - TYPE",?65,"STOP CD/CLINIC"
47 W !,"===",?6,"==========",?19,"=======",?28,"========",?45,"============",?65,"==============="
48 Q
49VT S I2="" F Z1=1:1 S I2=$O(^UTILITY($J,"OPV",I1,I2)) Q:I2=""!IBQUIT S I3="" F I4=1:1 S I3=$O(^UTILITY($J,"OPV",I1,I2,I3)) Q:I3="" S IBOPV3=^UTILITY($J,"OPV",I1,I2,I3) D VT1 Q:IBQUIT
50 Q
51VT1 D SCR Q:IBQUIT I (Z1>1)!(I4>1) W:$X>1 ! W ?5,$G(IBDATE)
52 W ?19,$P(IBOPV3,"^") W:$P(IBOPV3,"^",2)]"" "/"_$P(IBOPV3,"^",2)
53 W:+$P(IBOPV3,U,8) ?28,$E($P($G(^VA(200,+$P(IBOPV3,U,8),0)),"^",1),1,15)
54 I Z1=1,I4=1,$P(^UTILITY($J,"OPV","AP",I),"^",4)'="" W ?45,$J($P(^UTILITY($J,"OPV","AP",I),"^",4),7),"-",$P(^UTILITY($J,"OPV","AP",I),"^",5)
55 W ?65,$E($P(^UTILITY($J,"OPV",I1,I2,I3),"^",6),1,15)
56 W !
57 I $P($G(^IBT(356,+$O(^IBT(356,"ASCE",+$P(^UTILITY($J,"OPV",I1,I2,I3),"^",9),0)),0)),"^",19) W ?7,$E("**RNB: "_$P($G(^IBE(356.8,+$P(^(0),"^",19),0)),"^"),1,30)
58 I Z1=1,I4=1,$P(^UTILITY($J,"OPV","AP",I),"^",6)'="" W ?45,$J($P(^UTILITY($J,"OPV","AP",I),"^",6),7),"-",$P(^UTILITY($J,"OPV","AP",I),"^",7)
59 W ?65,$E($P(^UTILITY($J,"OPV",I1,I2,I3),"^",7),1,15)
60 I (Z1=1)&(I4=1) F P=8:2 Q:$P(^UTILITY($J,"OPV","AP",I),"^",P)="" W !,?45,$J($P(^UTILITY($J,"OPV","AP",I),"^",P),7),"-",$P(^UTILITY($J,"OPV","AP",I),"^",P+1)
61 Q
62SCR Q:IBQUIT I $E(IOST,1,2)["C-",$Y+6>IOSL F Y=$Y:1:IOSL-5 W !
63 I W !,"Press return to continue, ""^"" to exit display, or " D PICK I 'IBQUIT W @IOF D HDR1,HDR W !
64 Q
65HLP ;W !!,"Enter a number between 1 and ",DGCNT," or a list or range separated with commas",!,"or dashes, e.g., 1,3,5 or 2-4,8"
66 ;W !,"The number(s) must correspond to a visit." R H:5 K H
67 Q
68CHG W:(Z1=1)&(I4=1) ?31,$J($P(^UTILITY($J,"OPV","AP",I),"^",2),8) Q
69NOVT I 'DGCNT D HDR1 W !!,"NO OUTPATIENT VISITS FOUND DURING THE PERIOD COVERED BY THIS STATEMENT" D Q Q
Note: See TracBrowser for help on using the repository browser.