ABMDRPR2 ; IHS/ASDST/DMJ - Productivity Report-132 Width ;
;;2.6;IHS 3P BILLING SYSTEM;**21**;NOV 12, 2009;Build 379
;Original;TMD;
;IHS/SD/SDR - 2.6*21 - HEAT191849 - Fix for error <UNDEF>SUBHD^ABMDRPR2 - ABM("TXT") wasn't defined yet
;
PRINT ;EP for printing data
W:$D(ABM("PRINT",16)) @ABM("PRINT",16) S ABM("PG")=0 D HDB
S (ABM("CNT1"),ABM("CNT2"),ABM("CNT"),ABM("TOT1"),ABM("TOT2"),ABM("TOT"))=0,(ABM("A"),ABM("L"),ABM("V"))=""
S ABM("Z")="TMP(""ABM-PR"","_$J,ABM="^"_ABM("Z")_")" I '$D(@ABM) Q
F S ABM=$Q(@ABM) Q:ABM'[ABM("Z") D G:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) XIT
.;I $Y>(IOSL-5) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) D SUBHD W " (cont)" ;abm*2.6*21 IHS/SD/SDR HEAT191849
.S ABM("T")=$P(ABM,"ABM-P",2),ABM("TXT")=$P($P(ABM("T"),",",3,99),"""",2),ABM("TXT")=+$P(ABM("T"),",",3)_U_ABM("TXT")
.I $Y>(IOSL-5) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) D SUBHD W " (cont)" ;abm*2.6*21 IHS/SD/SDR HEAT191849
.S ABM("C")=$G(^ABMDBILL(DUZ(2),$P(ABM("TXT"),U,6),0)) Q:ABM("C")="" S ABM("D")=+^(7),ABM("T")=+^(2),ABM("EDT")=$P($G(^(1)),"^",7)
.S ABM("EDT")=$P($G(^ABMDTXST(DUZ(2),+ABM("EDT"),0)),U)
.I ABM("A")'=$P(ABM("TXT"),U) S ABM("L")="" D SUB,TOT,SUBHD
.S ABM("A")=$P(ABM("TXT"),U)
.I ABM("L")'=$P(ABM("TXT"),U,2) D SUB:ABM("L")]"" W:ABM("L")'="" ! W !?3,"Visit Location: ",$P(^DIC(4,$P(ABM("C"),U,3),0),U) S ABM("V")=""
.S ABM("L")=$P(ABM("TXT"),U,2)
.I ABM("V")'=$P(ABM("TXT"),U,3) D SUB2:ABM("V")]"" W:ABM("V")]"" ! W !?7,$S(ABMY("SORT")="C":" Clinic: "_$P(^DIC(40.7,$P(ABM("TXT"),U,3),0),U),1:"Visit Type: "_$P(^ABMDVTYP($P(ABM("TXT"),U,3),0),U))
.S ABM("V")=$P(ABM("TXT"),U,3)
.W ! W:ABM("I")'=$P(ABM("C"),U,8) $E($P(^AUTNINS($P(ABM("C"),U,8),0),U),1,30) S ABM("I")=$P(ABM("C"),U,8)
.W ?32,$P(ABM("C"),U),?40,$E($P(^DPT($P(ABM("C"),U,5),0),U),1,30)
.W ?72,$S($D(^AUPNPAT($P(ABM("C"),U,5),41,$P(ABM("C"),U,3),0)):$P(^(0),U,2),$D(^AUPNPAT($P(ABM("C"),U,5),41,DUZ(2),0)):$P(^(0),U,2),1:"")
.W ?80,$$SDT^ABMDUTL(ABM("D"))
.I ABMY("SORT")="V" W:+$P(ABM("C"),U,10) ?92,$E($P(^DIC(40.7,$P(ABM("C"),U,10),0),U),1,18)
.E W ?92,$E($P(^ABMDVTYP($P(ABM("C"),U,7),0),U),1,18)
.W ?110,$$SDT^ABMDUTL(ABM("EDT"))
.W ?121,$J($FN(ABM("T"),",",2),10)
.S ABM("CNT1")=ABM("CNT1")+1,ABM("CNT2")=ABM("CNT2")+1,ABM("CNT")=ABM("CNT")+1,ABM("TOT")=ABM("TOT")+ABM("T")
.S ABM("TOT1")=ABM("TOT1")+ABM("T"),ABM("TOT2")=ABM("TOT2")+ABM("T")
D SUB,TOT
Q
TOT Q:ABM("CNT")=0 W !?32,"======",?121,"=========="
W !?3,"Grand Total:",?32,ABM("CNT"),?121,$J($FN(ABM("TOT"),",",2),10)
S ABM("TOT")=0,ABM("CNT")=0
Q
;
HD D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
HDB S ABM("PG")=ABM("PG")+1,ABM("I")="" D WHD^ABMDRHD
W !,?32,"Claim",?81,"Visit",?113,"Export",?123,"Billed"
W !?10,"Insurer",?32,"Number",?47,"Patient",?73,"HRN",?81,"Date",?94,$S(ABMY("SORT")="V":"Clinic",1:"Visit Type"),?114,"Date",?123,"Amount"
S $P(ABM("LINE"),"-",132)="" W !,ABM("LINE") K ABM("LINE")
Q
;
SUBHD Q:$D(ABMY("APPR")) W !!,"Approving Official: ",$P(^VA(200,$P(ABM("TXT"),U),0),U)
Q
;
SUB2 Q:'ABM("CNT2")
W !?32,"------",?121,"----------"
W !?5,"Sub-total:",?32,ABM("CNT2"),?121,$J($FN(ABM("TOT2"),",",2),10)
S ABM("CNT2")=0,ABM("TOT2")=0,ABM("I")=""
Q
;
SUB Q:'ABM("CNT1") D SUB2:ABM("CNT1")'=ABM("CNT2")
W !?32,"------",?121,"----------"
W !?9,"Total:",?32,ABM("CNT1"),?121,$J($FN(ABM("TOT1"),",",2),10)
S ABM("CNT1")=0,ABM("TOT1")=0,ABM("CNT2")=0,ABM("TOT2")=0,ABM("I")=""
Q
XIT ;EXIT POINT
Q
ABMDRPR2 ; IHS/ASDST/DMJ - Productivity Report-132 Width ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**21**;NOV 12, 2009;Build 379
+2 ;Original;TMD;
+3 ;IHS/SD/SDR - 2.6*21 - HEAT191849 - Fix for error <UNDEF>SUBHD^ABMDRPR2 - ABM("TXT") wasn't defined yet
+4 ;
PRINT ;EP for printing data
+1 IF $DATA(ABM("PRINT",16))
WRITE @ABM("PRINT",16)
SET ABM("PG")=0
DO HDB
+2 SET (ABM("CNT1"),ABM("CNT2"),ABM("CNT"),ABM("TOT1"),ABM("TOT2"),ABM("TOT"))=0
SET (ABM("A"),ABM("L"),ABM("V"))=""
+3 SET ABM("Z")="TMP(""ABM-PR"","_$JOB
SET ABM="^"_ABM("Z")_")"
IF '$DATA(@ABM)
QUIT
+4 FOR
SET ABM=$QUERY(@ABM)
IF ABM'[ABM("Z")
QUIT
Begin DoDot:1
+5 ;I $Y>(IOSL-5) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) D SUBHD W " (cont)" ;abm*2.6*21 IHS/SD/SDR HEAT191849
+6 SET ABM("T")=$PIECE(ABM,"ABM-P",2)
SET ABM("TXT")=$PIECE($PIECE(ABM("T"),",",3,99),"""",2)
SET ABM("TXT")=+$PIECE(ABM("T"),",",3)_U_ABM("TXT")
+7 ;abm*2.6*21 IHS/SD/SDR HEAT191849
IF $Y>(IOSL-5)
DO HD
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
DO SUBHD
WRITE " (cont)"
+8 SET ABM("C")=$GET(^ABMDBILL(DUZ(2),$PIECE(ABM("TXT"),U,6),0))
IF ABM("C")=""
QUIT
SET ABM("D")=+^(7)
SET ABM("T")=+^(2)
SET ABM("EDT")=$PIECE($GET(^(1)),"^",7)
+9 SET ABM("EDT")=$PIECE($GET(^ABMDTXST(DUZ(2),+ABM("EDT"),0)),U)
+10 IF ABM("A")'=$PIECE(ABM("TXT"),U)
SET ABM("L")=""
DO SUB
DO TOT
DO SUBHD
+11 SET ABM("A")=$PIECE(ABM("TXT"),U)
+12 IF ABM("L")'=$PIECE(ABM("TXT"),U,2)
IF ABM("L")]""
DO SUB
IF ABM("L")'=""
WRITE !
WRITE !?3,"Visit Location: ",$PIECE(^DIC(4,$PIECE(ABM("C"),U,3),0),U)
SET ABM("V")=""
+13 SET ABM("L")=$PIECE(ABM("TXT"),U,2)
+14 IF ABM("V")'=$PIECE(ABM("TXT"),U,3)
IF ABM("V")]""
DO SUB2
IF ABM("V")]""
WRITE !
WRITE !?7,$SELECT(ABMY("SORT")="C":" Clinic: "_$PIECE(^DIC(40.7,$PIECE(ABM("TXT"),U,3),0),U),1:"Visit Type: "_$PIECE(^ABMDVTYP($PIECE(ABM("TXT"),U,3),0),U))
+15 SET ABM("V")=$PIECE(ABM("TXT"),U,3)
+16 WRITE !
IF ABM("I")'=$PIECE(ABM("C"),U,8)
WRITE $EXTRACT($PIECE(^AUTNINS($PIECE(ABM("C"),U,8),0),U),1,30)
SET ABM("I")=$PIECE(ABM("C"),U,8)
+17 WRITE ?32,$PIECE(ABM("C"),U),?40,$EXTRACT($PIECE(^DPT($PIECE(ABM("C"),U,5),0),U),1,30)
+18 WRITE ?72,$SELECT($DATA(^AUPNPAT($PIECE(ABM("C"),U,5),41,$PIECE(ABM("C"),U,3),0)):$PIECE(^(0),U,2),$DATA(^AUPNPAT($PIECE(ABM("C"),U,5),41,DUZ(2),0)):$PIECE(^(0),U,2),1:"")
+19 WRITE ?80,$$SDT^ABMDUTL(ABM("D"))
+20 IF ABMY("SORT")="V"
IF +$PIECE(ABM("C"),U,10)
WRITE ?92,$EXTRACT($PIECE(^DIC(40.7,$PIECE(ABM("C"),U,10),0),U),1,18)
+21 IF '$TEST
WRITE ?92,$EXTRACT($PIECE(^ABMDVTYP($PIECE(ABM("C"),U,7),0),U),1,18)
+22 WRITE ?110,$$SDT^ABMDUTL(ABM("EDT"))
+23 WRITE ?121,$JUSTIFY($FNUMBER(ABM("T"),",",2),10)
+24 SET ABM("CNT1")=ABM("CNT1")+1
SET ABM("CNT2")=ABM("CNT2")+1
SET ABM("CNT")=ABM("CNT")+1
SET ABM("TOT")=ABM("TOT")+ABM("T")
+25 SET ABM("TOT1")=ABM("TOT1")+ABM("T")
SET ABM("TOT2")=ABM("TOT2")+ABM("T")
End DoDot:1
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO XIT
+26 DO SUB
DO TOT
+27 QUIT
TOT IF ABM("CNT")=0
QUIT
WRITE !?32,"======",?121,"=========="
+1 WRITE !?3,"Grand Total:",?32,ABM("CNT"),?121,$JUSTIFY($FNUMBER(ABM("TOT"),",",2),10)
+2 SET ABM("TOT")=0
SET ABM("CNT")=0
+3 QUIT
+4 ;
HD DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
HDB SET ABM("PG")=ABM("PG")+1
SET ABM("I")=""
DO WHD^ABMDRHD
+1 WRITE !,?32,"Claim",?81,"Visit",?113,"Export",?123,"Billed"
+2 WRITE !?10,"Insurer",?32,"Number",?47,"Patient",?73,"HRN",?81,"Date",?94,$SELECT(ABMY("SORT")="V":"Clinic",1:"Visit Type"),?114,"Date",?123,"Amount"
+3 SET $PIECE(ABM("LINE"),"-",132)=""
WRITE !,ABM("LINE")
KILL ABM("LINE")
+4 QUIT
+5 ;
SUBHD IF $DATA(ABMY("APPR"))
QUIT
WRITE !!,"Approving Official: ",$PIECE(^VA(200,$PIECE(ABM("TXT"),U),0),U)
+1 QUIT
+2 ;
SUB2 IF 'ABM("CNT2")
QUIT
+1 WRITE !?32,"------",?121,"----------"
+2 WRITE !?5,"Sub-total:",?32,ABM("CNT2"),?121,$JUSTIFY($FNUMBER(ABM("TOT2"),",",2),10)
+3 SET ABM("CNT2")=0
SET ABM("TOT2")=0
SET ABM("I")=""
+4 QUIT
+5 ;
SUB IF 'ABM("CNT1")
QUIT
IF ABM("CNT1")'=ABM("CNT2")
DO SUB2
+1 WRITE !?32,"------",?121,"----------"
+2 WRITE !?9,"Total:",?32,ABM("CNT1"),?121,$JUSTIFY($FNUMBER(ABM("TOT1"),",",2),10)
+3 SET ABM("CNT1")=0
SET ABM("TOT1")=0
SET ABM("CNT2")=0
SET ABM("TOT2")=0
SET ABM("I")=""
+4 QUIT
XIT ;EXIT POINT
+1 QUIT