ABMRSTI3 ; IHS/SD/SDR - Split Claim Billing - split report (part 3);
;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
;IHS/SD/SDR 2.6*22 HEAT335246 - New routine
;
PRINT ;EP
S ABM("HD",1)="with "_$S(ABMY("DT")="V":"Visit",1:"Approval")_" Dates from "_$$SDT^ABMDUTL(ABMY("DT",1))_" to "_$$SDT^ABMDUTL(ABMY("DT",2))
S ABM("HD",1)=ABM("HD",1)_" AND for page"_$S(($L(ABMY("PGS"),"^")>3):"s",1:"")_" "_$E($TR($G(ABMY("PGS")),"^",","),2,$L(ABMY("PGS"))-1)
S ABM("HD",2)="for insurer"_$S((+$G(ABMY("INS"))>1):"s",1:"")_" "
S ABMI=0
S ABMJ=0
F S ABMI=$O(ABMY("INS",ABMI)) Q:'ABMI S ABM("HD",2)=ABM("HD",2)_$S(ABMJ=1:", ",1:"")_$P($G(^AUTNINS(ABMI,0)),U) S ABMJ=1
S ABM("PG")=0
;
PRINT2 ;EP
D HDB
S ABMCDFN=0
S ABMOCNT=0
S ABMNCNT=0
F S ABMCDFN=$O(^TMP("ABM-STIN",$J,"NEWCLMLST",ABMCDFN)) Q:'ABMCDFN D
.I $Y>(IOSL-9) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) W " (cont)"
.W !,ABMCDFN ;original claim#
.W ?12,$P($G(^AUTNINS($P($G(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,8),0)),U) ;active insurer
.S ABMVLOC=$P($G(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,3)
.S ABMPT=$P($G(^ABMDCLM(DUZ(2),ABMCDFN,0)),U)
.S ABMHRN=$P($G(^AUPNPAT(ABMPT,41,ABMVLOC,0)),U,2)
.W ?45,ABMHRN ;HRN
.W ?53,$$SDTO^ABMDUTL($P($G(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,2)) ;visit date
.W ?65,$E($P($G(^DIC(40.7,$P($G(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,6),0)),U),1,14) ;clinic
.S ABMOCNT=+$G(ABMOCNT)+1
.S ABMCDFN2=0
.F S ABMCDFN2=$O(^TMP("ABM-STIN",$J,"NEWCLMLST",ABMCDFN,ABMCDFN2)) Q:'ABMCDFN2 D
..W !?15,ABMCDFN2 ;new claim#
..S ABMNCNT=+$G(ABMNCNT)+1
..S ABMPG=""
..F S ABMPG=$O(^TMP("ABM-STIN",$J,"NEWCLMLST",ABMCDFN,ABMCDFN2,ABMPG)) Q:$G(ABMPG)="" D
...S ABMMLT=$S(ABMPG="8D":23,ABMPG="8E":37,ABMPG="8F":35,1:43)
...S ABMJ=0
...F S ABMJ=$O(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ)) Q:'ABMJ D
....I ABMMLT=23 D
.....S ABMCODE=$S($P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,6)'="":$P(^(0),U,6),$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,22):$$GET1^DIQ(52,$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,22),".01","E"),1:ABMJ_"NORX#") ;RX#
.....S ABMDESC=$S($P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,24):$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,24),1:"<NO NDC>")_" "_$$GET1^DIQ(50,$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U),".01","E")
....I ABMMLT'=23 D
.....S ABMCODE=$P($$CPT^ABMCVAPI($P($G(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U),$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,0)),U,2)),U,2)
.....S ABMDESC=$P($$CPT^ABMCVAPI(ABMCODE,$P($G(^ABMDCLM(DUZ(2),ABMCDFN2,0)),U,2)),U,3)
....I ABMCODE["NORX" S ABMCODE="NORX#"
....W ?26,ABMCODE ;Ref#
....W ?37,$E(ABMDESC,1,40) ;description
....I $G(ABMY("SPLITHOW"))'=1 W !
I $G(ABMY("SPLIT"))="A" W !!,"<End of Report>"
Q
HD ;
D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
HDB ;
I $G(ABMY("SPLIT"))="A" S ABM("PG")=ABM("PG")+1 D WHD^ABMDRHD
W !,"Orig Clm#",?12,"Active Insurer",?45,"HRN",?53,"Visit Date",?65,"Clinic"
W !?15,"New Clm#",?26,"Ref#",?37,"Description",!
F I=1:1:80 W "-"
Q
ABMRSTI3 ; IHS/SD/SDR - Split Claim Billing - split report (part 3);
+1 ;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
+2 ;IHS/SD/SDR 2.6*22 HEAT335246 - New routine
+3 ;
PRINT ;EP
+1 SET ABM("HD",1)="with "_$SELECT(ABMY("DT")="V":"Visit",1:"Approval")_" Dates from "_$$SDT^ABMDUTL(ABMY("DT",1))_" to "_$$SDT^ABMDUTL(ABMY("DT",2))
+2 SET ABM("HD",1)=ABM("HD",1)_" AND for page"_$SELECT(($LENGTH(ABMY("PGS"),"^")>3):"s",1:"")_" "_$EXTRACT($TRANSLATE($GET(ABMY("PGS")),"^",","),2,$LENGTH(ABMY("PGS"))-1)
+3 SET ABM("HD",2)="for insurer"_$SELECT((+$GET(ABMY("INS"))>1):"s",1:"")_" "
+4 SET ABMI=0
+5 SET ABMJ=0
+6 FOR
SET ABMI=$ORDER(ABMY("INS",ABMI))
IF 'ABMI
QUIT
SET ABM("HD",2)=ABM("HD",2)_$SELECT(ABMJ=1:", ",1:"")_$PIECE($GET(^AUTNINS(ABMI,0)),U)
SET ABMJ=1
+7 SET ABM("PG")=0
+8 ;
PRINT2 ;EP
+1 DO HDB
+2 SET ABMCDFN=0
+3 SET ABMOCNT=0
+4 SET ABMNCNT=0
+5 FOR
SET ABMCDFN=$ORDER(^TMP("ABM-STIN",$JOB,"NEWCLMLST",ABMCDFN))
IF 'ABMCDFN
QUIT
Begin DoDot:1
+6 IF $Y>(IOSL-9)
DO HD
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
WRITE " (cont)"
+7 ;original claim#
WRITE !,ABMCDFN
+8 ;active insurer
WRITE ?12,$PIECE($GET(^AUTNINS($PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,8),0)),U)
+9 SET ABMVLOC=$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,3)
+10 SET ABMPT=$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN,0)),U)
+11 SET ABMHRN=$PIECE($GET(^AUPNPAT(ABMPT,41,ABMVLOC,0)),U,2)
+12 ;HRN
WRITE ?45,ABMHRN
+13 ;visit date
WRITE ?53,$$SDTO^ABMDUTL($PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,2))
+14 ;clinic
WRITE ?65,$EXTRACT($PIECE($GET(^DIC(40.7,$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN,0)),U,6),0)),U),1,14)
+15 SET ABMOCNT=+$GET(ABMOCNT)+1
+16 SET ABMCDFN2=0
+17 FOR
SET ABMCDFN2=$ORDER(^TMP("ABM-STIN",$JOB,"NEWCLMLST",ABMCDFN,ABMCDFN2))
IF 'ABMCDFN2
QUIT
Begin DoDot:2
+18 ;new claim#
WRITE !?15,ABMCDFN2
+19 SET ABMNCNT=+$GET(ABMNCNT)+1
+20 SET ABMPG=""
+21 FOR
SET ABMPG=$ORDER(^TMP("ABM-STIN",$JOB,"NEWCLMLST",ABMCDFN,ABMCDFN2,ABMPG))
IF $GET(ABMPG)=""
QUIT
Begin DoDot:3
+22 SET ABMMLT=$SELECT(ABMPG="8D":23,ABMPG="8E":37,ABMPG="8F":35,1:43)
+23 SET ABMJ=0
+24 FOR
SET ABMJ=$ORDER(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ))
IF 'ABMJ
QUIT
Begin DoDot:4
+25 IF ABMMLT=23
Begin DoDot:5
+26 ;RX#
SET ABMCODE=$SELECT($PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,6)'="":$PIECE(^(0),U,6),$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,22):$$GET1^DIQ(52,...
... $PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,22),".01","E"),1:ABMJ_"NORX#")
+27 SET ABMDESC=$SELECT($PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,24):$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U,24),1:"<NO NDC>")_" "_$$GET1^DIQ(50,$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDF
N2,ABMMLT,ABMJ,0)),U),".01","E")
End DoDot:5
+28 IF ABMMLT'=23
Begin DoDot:5
+29 SET ABMCODE=$PIECE($$CPT^ABMCVAPI($PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,ABMMLT,ABMJ,0)),U),$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,0)),U,2)),U,2)
+30 SET ABMDESC=$PIECE($$CPT^ABMCVAPI(ABMCODE,$PIECE($GET(^ABMDCLM(DUZ(2),ABMCDFN2,0)),U,2)),U,3)
End DoDot:5
+31 IF ABMCODE["NORX"
SET ABMCODE="NORX#"
+32 ;Ref#
WRITE ?26,ABMCODE
+33 ;description
WRITE ?37,$EXTRACT(ABMDESC,1,40)
+34 IF $GET(ABMY("SPLITHOW"))'=1
WRITE !
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+35 IF $GET(ABMY("SPLIT"))="A"
WRITE !!,"<End of Report>"
+36 QUIT
HD ;
+1 DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
HDB ;
+1 IF $GET(ABMY("SPLIT"))="A"
SET ABM("PG")=ABM("PG")+1
DO WHD^ABMDRHD
+2 WRITE !,"Orig Clm#",?12,"Active Insurer",?45,"HRN",?53,"Visit Date",?65,"Clinic"
+3 WRITE !?15,"New Clm#",?26,"Ref#",?37,"Description",!
+4 FOR I=1:1:80
WRITE "-"
+5 QUIT