ABMUCPR ; IHS/SD/SDR - UFMS Cashiering Session Productivity Report ;
;;2.6;IHS Third Party Billing;**1,11**;NOV 12, 2009;Build 133
;
; IHS/SD/SDR - abm*2.6*1 - NO HEAT - Added averages and fixed
; "^" out of report
; IHS/SD/SDR - abm*2.6*11 - adde V to list of codes
;
K ABM,ABMY
S ABM("HD",0)="Cashiering Session Productivity Report"
S ABM("POS")=1
S ABM("SSTAT","A")=""
S $P(ABMDASH,"=",79)="="
; start new code abm*2.6*1 NOHEAT
W !!!?5,"This report will only look at closed or transmitted/reconciled sessions."
W !?5,"All open/reopened sessions will be ignored."
;end new code abm*2.6*1
;
SEL ;
S ABM("NODX")="" D ^ABMURSEL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
D ^ABMURHD
S ABMQ("RC")="COMPUTE^ABMUCPR"
S ABMQ("RX")="POUT^ABMDRUTL"
S ABMQ("NS")="ABM"
S ABMQ("RP")="PRINT^ABMUCPR"
D ^ABMDRDBQ
Q ;abm*2.6*11
;
COMPUTE ;EP - Entry Point for Setting up Data
S ABM("SUBR")="ABM-UCR" K ^TMP("ABM-UCR",$J)
S ABM("PG")=0
LOOP ; loop through sessions
S ABMLOC=$$FINDLOC^ABMUCUTL
K ABMZ ;abm*2.6*1 NO HEAT
S ABM("HD",1)="For Location: "_$P($G(^DIC(4,ABMLOC,0)),U)
I '$D(ABMY("USER")) S ABM("HD",2)="For ALL users"_$S($G(ABMY("POS"))=1:" Including",1:" Excluding")_" POS Claims"
E D
.S ABM("HD",2)="For user(s): "
.S ABMU=0
.F S ABMU=$O(ABMY("USER",ABMU)) Q:+ABMU=0 S ABM("HD",2)=ABM("HD",2)_$S($G(ABMFLG)=1:", ",1:"")_$P($G(^VA(200,ABMU,0)),U),^TMP("ABM-UCR",$J,$P($G(^VA(200,ABMU,0)),U))="",ABMFLG=1
.S ABM("HD",2)=ABM("HD",2)_$S($G(ABMFLG)=1:",",1:"")_$S($G(ABMY("POS"))=1:" Including",1:" Excluding")_" POS CLAIMS"
S ABMU=0
S ABMLOOP=10
F S ABMU=$O(^ABMUCASH(ABMLOC,10,ABMU)) Q:+ABMU=0 D
.I $D(ABMY("USER")) Q:'$D(ABMY("USER",ABMU)) ;select users only
.S ABMUO=$P($G(^VA(200,ABMU,0)),U)
.S ABMFROM=$S($G(ABMY("DT",1)):ABMY("DT",1),1:0) ;from date
.S ABMTO=$S($G(ABMY("DT",2)):ABMY("DT",2)_".999999",1:9999999) ;to date
.F S ABMFROM=$O(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM)) Q:+ABMFROM=0!(ABMFROM>ABMTO) D
..;check session status
..I "^O^S^"[("^"_$P($G(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM,0)),U,4)_"^") Q ;skip open/reopened sessions ;abm*2.6*1 NO HEAT
..I '$D(ABMY("SSTAT","A"))&'$D(ABMY("SSTAT",$P($G(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM,0)),U,4))) Q
..D DATA
I $G(ABMY("POS"))=1 D
.S ABMLOOP=20
.S ABMU=1,ABMUO="POS CLAIMS"
.S ABMFROM=$S($G(ABMY("DT",1)):ABMY("DT",1),1:0) ;from date
.S ABMTO=$S($G(ABMY("DT",2)):ABMY("DT",2),1:9999999) ;to date
.F S ABMFROM=$O(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM)) Q:+ABMFROM=0!(ABMFROM>ABMTO) D
..;check session status
..I "^O^S^"[("^"_$P($G(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM,0)),U,4)_"^") Q ;skip open/reopened sessions ;abm*2.6*1 NO HEAT
..I '$D(ABMY("SSTAT","A"))&'$D(ABMY("SSTAT",$P($G(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM,0)),U,4))) Q
..D DATA
Q
;
DATA ;
S ABMDAYS=+($S($P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3):$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3),1:DT)-ABMFROM) ;abm*2.6*1 NO HEAT
I ABMDAYS<1 S ABMDAYS=1 ;abm*2.6*1 NO HEAT
S ABMZ(ABMUO,"ABMTDAYS")=+$G(ABMZ(ABMUO,"ABMTDAYS"))+ABMDAYS ;abm*2.6*1 NO HEAT
S ABMZ(ABMUO,"SCNT")=+$G(ABMZ(ABMUO,"SCNT"))+1 ;abm*2.6*1 NO HEAT
;budget activity
;S ^TMP("ABM-UCR",$J,ABMUO,ABMFROM)=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,4) ;abm*2.6*1 NO HEAT
S ^TMP("ABM-UCR",$J,ABMUO,ABMFROM)=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,4)_"^"_$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3) ;abm*2.6*1 NO HEAT
S ABMB=0
F S ABMB=$O(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB)) Q:+ABMB=0 D
.;S ABMBA=$P($T(@$G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,0))),";;",2) ;abm*2.6*11
.S ABMBA=$P($T(@($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,0)))^ABMUVBCH),";;",2) ;abm*2.6*11
.;
.;approved bills
.S ABMAB=0
.F S ABMAB=$O(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB)) Q:+ABMAB=0 D
..S ^TMP("ABM-UCR",$J,ABMUO,"AB",ABMBA,"CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"AB",ABMBA,"CNT"))+1
..S ^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","CNT"))+1
..S ABMDUZ=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB,0)),U,2)
..S ABMIEN=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB,0)),U,3)
..S ^TMP("ABM-UCR",$J,ABMUO,"AB",ABMBA,"AMT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"AB",ABMBA,"AMT"))+$P($G(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
..S ^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","AMT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","AMT"))+$P($G(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
.Q:ABMLOOP=20 ;don't do cancelled anything for POS user
.;
.;cancelled claims
.S ABMCC=0
.F S ABMCC=$O(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,1,ABMCC)) Q:+ABMCC=0 D
..S ^TMP("ABM-UCR",$J,ABMUO,"CC",ABMBA,"CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"CC",ABMBA,"CNT"))+1
..S ^TMP("ABM-UCR",$J,ABMUO,"TOT","CC","CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CC","CNT"))+1
.;
.;cancelled bills
.S ABMCB=0
.F S ABMCB=$O(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB)) Q:+ABMCB=0 D
..S ^TMP("ABM-UCR",$J,ABMUO,"CB",ABMBA,"CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"CB",ABMBA,"CNT"))+1
..S ^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","CNT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","CNT"))+1
..S ABMDUZ=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB,0)),U,2)
..S ABMIEN=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB,0)),U,3)
..S ^TMP("ABM-UCR",$J,ABMUO,"CB",ABMBA,"AMT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"CB",ABMBA,"AMT"))+$P($G(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
..S ^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","AMT")=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","AMT"))+$P($G(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
Q
PRINT ;
D HDB
S ABMUO=""
S ABMO=""
F S ABMUO=$O(^TMP("ABM-UCR",$J,ABMUO)) Q:ABMUO="" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
.I ($G(ABMO)'=""),($G(ABMO)'=ABMUO) W !,ABMDASH
.S ABMO=ABMUO
.W !,"Statistics for ",ABMUO
.F ABMBC="AB","CC","CB" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
..Q:(ABMUO="POS CLAIMS")&(ABMBC'="AB")
..W !?5,$S(ABMBC="AB":"BILLED",ABMBC="CC":"CANCELLED CLAIMS",1:"CANCELLED BILLS")
..;F ABMBA="MEDICARE","MEDICAID","PRIVATE INSURANCE","OTHER" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ;abm*2.6*11
..F ABMBA="MEDICARE","MEDICAID","PRIVATE INSURANCE","OTHER","VET" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ;abm*2.6*11
...W !?10,ABMBA
...W ?35,$J(+$G(^TMP("ABM-UCR",$J,ABMUO,ABMBC,ABMBA,"CNT")),6)
...I ABMBC="AB"!(ABMBC="CB") W ?50,$J($FN(+$G(^TMP("ABM-UCR",$J,ABMUO,ABMBC,ABMBA,"AMT")),",",2),"10R")
..W !?35,"------"
..W:ABMBC["B" ?50,"----------"
..W !?20,"Total "_$S(ABMBC="AB"!(ABMBC="CB"):"Bills",1:"Claims"),?35,$J(+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT",ABMBC,"CNT")),6)
..W:ABMBC["B" ?50,$J($FN(+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT",ABMBC,"AMT")),",",2),"10R")
..W !
..I $Y>(IOSL-5) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) W " (cont)"
.;
.;start new code abm*2.6*1 NO HEAT
.S (ABMABAVG,ABMABTOT,ABMCBAVG,ABMCBTOT,ABMCCAVG,ABMSAVG)=0
.D CALC
.W !,"Average approved bills a day: "_$J(ABMABAVG,",",3)_" for $"_$J(ABMABTOT,",",2)
.W !,"Average cancelled BILLS a day: "_$J(ABMCBAVG,",",3)_" for $"_$J(ABMCBTOT,",",2)
.W !,"Average cancelled CLAIMS a day: "_$J(ABMCCAVG,",",3)
.W !,"Average hours/mins session was open: "_ABMSAVG
.;end new code NO HEAT
.;
.W !!,"Cashiering Sessions used:"
.I +$O(^TMP("ABM-UCR",$J,ABMUO,0))=0 W !?5,"NO SESSIONS FOUND"
.S ABMFROM=0
.F S ABMFROM=$O(^TMP("ABM-UCR",$J,ABMUO,ABMFROM)) Q:+ABMFROM=0 D
..W !?5,ABMFROM
..;S ABMST=$G(^TMP("ABM-UCR",$J,ABMUO,ABMFROM)) ;abm*2.6*1 NO HEAT
..W " - "_$P($G(^TMP("ABM-UCR",$J,ABMUO,ABMFROM)),U,2)_" " ;abm*2.6*1 NO HEAT
..S ABMST=$P($G(^TMP("ABM-UCR",$J,ABMUO,ABMFROM)),U) ;abm*2.6*1 NO HEAT
..S ABMST=$S(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",ABMST="S":"RE-OPENED",1:"TRANSMITTED")
..W ?20,"(",ABMST,")"
Q
HD D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
HDB S ABM("PG")=ABM("PG")+1,ABM("I")="" D WHD^ABMURHD
Q
;start new code abm*2.6*1 NO HEAT
CALC ;
Q:'$D(ABMZ(ABMUO)) ;user doesn't have any sessions ;abm*2.6*1 NO HEAT
ABILLS S ABMABAVG=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
S ABMABTOT=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","AMT"))/+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","AB","CNT"),1)
CBILLS S ABMCBAVG=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
S ABMCBTOT=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","AMT"))/+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CB","CNT"),1)
CCLMS S ABMCCAVG=+$G(^TMP("ABM-UCR",$J,ABMUO,"TOT","CC","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
S ABMSAVG=$P(ABMZ(ABMUO,"ABMTDAYS"),".")*24 ;convert days to hours
S ABMSAVG=(ABMSAVG+($E($P(ABMZ(ABMUO,"ABMTDAYS"),".",2),1,2)))*60 ;convert hours to minutes
S ABMSAVG=ABMSAVG+$E($P(ABMZ(ABMUO,"ABMTDAYS"),".",2),3,4) ;add remaining minutes
S ABMSAVG=ABMSAVG_"."_$E($P(ABMZ(ABMUO,"ABMTDAYS"),".",2),5,6) ;seconds as decimal
S ABMSAVG=ABMSAVG/(+$G(ABMZ(ABMUO,"SCNT"),1)) ;divide by number of sessions
S ABMSAVG=ABMSAVG/60 ;convert back to hours/mins
Q
;end new code NO HEAT
ABMUCPR ; IHS/SD/SDR - UFMS Cashiering Session Productivity Report ;
+1 ;;2.6;IHS Third Party Billing;**1,11**;NOV 12, 2009;Build 133
+2 ;
+3 ; IHS/SD/SDR - abm*2.6*1 - NO HEAT - Added averages and fixed
+4 ; "^" out of report
+5 ; IHS/SD/SDR - abm*2.6*11 - adde V to list of codes
+6 ;
+7 KILL ABM,ABMY
+8 SET ABM("HD",0)="Cashiering Session Productivity Report"
+9 SET ABM("POS")=1
+10 SET ABM("SSTAT","A")=""
+11 SET $PIECE(ABMDASH,"=",79)="="
+12 ; start new code abm*2.6*1 NOHEAT
+13 WRITE !!!?5,"This report will only look at closed or transmitted/reconciled sessions."
+14 WRITE !?5,"All open/reopened sessions will be ignored."
+15 ;end new code abm*2.6*1
+16 ;
SEL ;
+1 SET ABM("NODX")=""
DO ^ABMURSEL
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
+2 DO ^ABMURHD
+3 SET ABMQ("RC")="COMPUTE^ABMUCPR"
+4 SET ABMQ("RX")="POUT^ABMDRUTL"
+5 SET ABMQ("NS")="ABM"
+6 SET ABMQ("RP")="PRINT^ABMUCPR"
+7 DO ^ABMDRDBQ
+8 ;abm*2.6*11
QUIT
+9 ;
COMPUTE ;EP - Entry Point for Setting up Data
+1 SET ABM("SUBR")="ABM-UCR"
KILL ^TMP("ABM-UCR",$JOB)
+2 SET ABM("PG")=0
LOOP ; loop through sessions
+1 SET ABMLOC=$$FINDLOC^ABMUCUTL
+2 ;abm*2.6*1 NO HEAT
KILL ABMZ
+3 SET ABM("HD",1)="For Location: "_$PIECE($GET(^DIC(4,ABMLOC,0)),U)
+4 IF '$DATA(ABMY("USER"))
SET ABM("HD",2)="For ALL users"_$SELECT($GET(ABMY("POS"))=1:" Including",1:" Excluding")_" POS Claims"
+5 IF '$TEST
Begin DoDot:1
+6 SET ABM("HD",2)="For user(s): "
+7 SET ABMU=0
+8 FOR
SET ABMU=$ORDER(ABMY("USER",ABMU))
IF +ABMU=0
QUIT
SET ABM("HD",2)=ABM("HD",2)_$SELECT($GET(ABMFLG)=1:", ",1:"")_$PIECE($GET(^VA(200,ABMU,0)),U)
SET ^TMP("ABM-UCR",$JOB,$PIECE($GET(^VA(200,ABMU,0)),U))=""
SET ABMFLG=1
+9 SET ABM("HD",2)=ABM("HD",2)_$SELECT($GET(ABMFLG)=1:",",1:"")_$SELECT($GET(ABMY("POS"))=1:" Including",1:" Excluding")_" POS CLAIMS"
End DoDot:1
+10 SET ABMU=0
+11 SET ABMLOOP=10
+12 FOR
SET ABMU=$ORDER(^ABMUCASH(ABMLOC,10,ABMU))
IF +ABMU=0
QUIT
Begin DoDot:1
+13 ;select users only
IF $DATA(ABMY("USER"))
IF '$DATA(ABMY("USER",ABMU))
QUIT
+14 SET ABMUO=$PIECE($GET(^VA(200,ABMU,0)),U)
+15 ;from date
SET ABMFROM=$SELECT($GET(ABMY("DT",1)):ABMY("DT",1),1:0)
+16 ;to date
SET ABMTO=$SELECT($GET(ABMY("DT",2)):ABMY("DT",2)_".999999",1:9999999)
+17 FOR
SET ABMFROM=$ORDER(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM))
IF +ABMFROM=0!(ABMFROM>ABMTO)
QUIT
Begin DoDot:2
+18 ;check session status
+19 ;skip open/reopened sessions ;abm*2.6*1 NO HEAT
IF "^O^S^"[("^"_$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM,0)),U,4)_"^")
QUIT
+20 IF '$DATA">DATA(ABMY("SSTAT","A"))&'$DATA">DATA(ABMY("SSTAT",$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMU,20,ABMFROM,0)),U,4)))
QUIT
+21 DO DATA
End DoDot:2
End DoDot:1
+22 IF $GET(ABMY("POS"))=1
Begin DoDot:1
+23 SET ABMLOOP=20
+24 SET ABMU=1
SET ABMUO="POS CLAIMS"
+25 ;from date
SET ABMFROM=$SELECT($GET(ABMY("DT",1)):ABMY("DT",1),1:0)
+26 ;to date
SET ABMTO=$SELECT($GET(ABMY("DT",2)):ABMY("DT",2),1:9999999)
+27 FOR
SET ABMFROM=$ORDER(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM))
IF +ABMFROM=0!(ABMFROM>ABMTO)
QUIT
Begin DoDot:2
+28 ;check session status
+29 ;skip open/reopened sessions ;abm*2.6*1 NO HEAT
IF "^O^S^"[("^"_$PIECE($GET(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM,0)),U,4)_"^")
QUIT
+30 IF '$DATA">DATA(ABMY("SSTAT","A"))&'$DATA">DATA(ABMY("SSTAT",$PIECE($GET(^ABMUCASH(ABMLOC,20,ABMU,20,ABMFROM,0)),U,4)))
QUIT
+31 DO DATA
End DoDot:2
End DoDot:1
+32 QUIT
+33 ;
DATA ;
+1 ;abm*2.6*1 NO HEAT
SET ABMDAYS=+($SELECT($PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3):$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3),1:DT)-ABMFROM)
+2 ;abm*2.6*1 NO HEAT
IF ABMDAYS<1
SET ABMDAYS=1
+3 ;abm*2.6*1 NO HEAT
SET ABMZ(ABMUO,"ABMTDAYS")=+$GET(ABMZ(ABMUO,"ABMTDAYS"))+ABMDAYS
+4 ;abm*2.6*1 NO HEAT
SET ABMZ(ABMUO,"SCNT")=+$GET(ABMZ(ABMUO,"SCNT"))+1
+5 ;budget activity
+6 ;S ^TMP("ABM-UCR",$J,ABMUO,ABMFROM)=$P($G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,4) ;abm*2.6*1 NO HEAT
+7 ;abm*2.6*1 NO HEAT
SET ^TMP("ABM-UCR",$JOB,ABMUO,ABMFROM)=$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,4)_"^"_$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,0)),U,3)
+8 SET ABMB=0
+9 FOR
SET ABMB=$ORDER(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB))
IF +ABMB=0
QUIT
Begin DoDot:1
+10 ;S ABMBA=$P($T(@$G(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,0))),";;",2) ;abm*2.6*11
+11 ;abm*2.6*11
SET ABMBA=$PIECE($TEXT(@($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,0)))^ABMUVBCH),";;",2)
+12 ;
+13 ;approved bills
+14 SET ABMAB=0
+15 FOR
SET ABMAB=$ORDER(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB))
IF +ABMAB=0
QUIT
Begin DoDot:2
+16 SET ^TMP("ABM-UCR",$JOB,ABMUO,"AB",ABMBA,"CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"AB",ABMBA,"CNT"))+1
+17 SET ^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","CNT"))+1
+18 SET ABMDUZ=$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB,0)),U,2)
+19 SET ABMIEN=$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,2,ABMAB,0)),U,3)
+20 SET ^TMP("ABM-UCR",$JOB,ABMUO,"AB",ABMBA,"AMT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"AB",ABMBA,"AMT"))+$PIECE($GET(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
+21 SET ^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","AMT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","AMT"))+$PIECE($GET(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
End DoDot:2
+22 ;don't do cancelled anything for POS user
IF ABMLOOP=20
QUIT
+23 ;
+24 ;cancelled claims
+25 SET ABMCC=0
+26 FOR
SET ABMCC=$ORDER(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,1,ABMCC))
IF +ABMCC=0
QUIT
Begin DoDot:2
+27 SET ^TMP("ABM-UCR",$JOB,ABMUO,"CC",ABMBA,"CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"CC",ABMBA,"CNT"))+1
+28 SET ^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CC","CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CC","CNT"))+1
End DoDot:2
+29 ;
+30 ;cancelled bills
+31 SET ABMCB=0
+32 FOR
SET ABMCB=$ORDER(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB))
IF +ABMCB=0
QUIT
Begin DoDot:2
+33 SET ^TMP("ABM-UCR",$JOB,ABMUO,"CB",ABMBA,"CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"CB",ABMBA,"CNT"))+1
+34 SET ^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","CNT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","CNT"))+1
+35 SET ABMDUZ=$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB,0)),U,2)
+36 SET ABMIEN=$PIECE($GET(^ABMUCASH(ABMLOC,ABMLOOP,ABMU,20,ABMFROM,11,ABMB,3,ABMCB,0)),U,3)
+37 SET ^TMP("ABM-UCR",$JOB,ABMUO,"CB",ABMBA,"AMT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"CB",ABMBA,"AMT"))+$PIECE($GET(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
+38 SET ^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","AMT")=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","AMT"))+$PIECE($GET(^ABMDBILL(ABMDUZ,ABMIEN,2)),U)
End DoDot:2
End DoDot:1
+39 QUIT
PRINT ;
+1 DO HDB
+2 SET ABMUO=""
+3 SET ABMO=""
+4 FOR
SET ABMUO=$ORDER(^TMP("ABM-UCR",$JOB,ABMUO))
IF ABMUO=""
QUIT
Begin DoDot:1
+5 IF ($GET(ABMO)'="")
IF ($GET(ABMO)'=ABMUO)
WRITE !,ABMDASH
+6 SET ABMO=ABMUO
+7 WRITE !,"Statistics for ",ABMUO
+8 FOR ABMBC="AB","CC","CB"
Begin DoDot:2
+9 IF (ABMUO="POS CLAIMS")&(ABMBC'="AB")
QUIT
+10 WRITE !?5,$SELECT(ABMBC="AB":"BILLED",ABMBC="CC":"CANCELLED CLAIMS",1:"CANCELLED BILLS")
+11 ;F ABMBA="MEDICARE","MEDICAID","PRIVATE INSURANCE","OTHER" D Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ;abm*2.6*11
+12 ;abm*2.6*11
FOR ABMBA="MEDICARE","MEDICAID","PRIVATE INSURANCE","OTHER","VET"
Begin DoDot:3
+13 WRITE !?10,ABMBA
+14 WRITE ?35,$JUSTIFY(+$GET(^TMP("ABM-UCR",$JOB,ABMUO,ABMBC,ABMBA,"CNT")),6)
+15 IF ABMBC="AB"!(ABMBC="CB")
WRITE ?50,$JUSTIFY($FNUMBER(+$GET(^TMP("ABM-UCR",$JOB,ABMUO,ABMBC,ABMBA,"AMT")),",",2),"10R")
End DoDot:3
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
+16 WRITE !?35,"------"
+17 IF ABMBC["B"
WRITE ?50,"----------"
+18 WRITE !?20,"Total "_$SELECT(ABMBC="AB"!(ABMBC="CB"):"Bills",1:"Claims"),?35,$JUSTIFY(+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT",ABMBC,"CNT")),6)
+19 IF ABMBC["B"
WRITE ?50,$JUSTIFY($FNUMBER(+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT",ABMBC,"AMT")),",",2),"10R")
+20 WRITE !
+21 IF $Y>(IOSL-5)
DO HD
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
WRITE " (cont)"
End DoDot:2
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
+22 ;
+23 ;start new code abm*2.6*1 NO HEAT
+24 SET (ABMABAVG,ABMABTOT,ABMCBAVG,ABMCBTOT,ABMCCAVG,ABMSAVG)=0
+25 DO CALC
+26 WRITE !,"Average approved bills a day: "_$JUSTIFY(ABMABAVG,",",3)_" for $"_$JUSTIFY(ABMABTOT,",",2)
+27 WRITE !,"Average cancelled BILLS a day: "_$JUSTIFY(ABMCBAVG,",",3)_" for $"_$JUSTIFY(ABMCBTOT,",",2)
+28 WRITE !,"Average cancelled CLAIMS a day: "_$JUSTIFY(ABMCCAVG,",",3)
+29 WRITE !,"Average hours/mins session was open: "_ABMSAVG
+30 ;end new code NO HEAT
+31 ;
+32 WRITE !!,"Cashiering Sessions used:"
+33 IF +$ORDER(^TMP("ABM-UCR",$JOB,ABMUO,0))=0
WRITE !?5,"NO SESSIONS FOUND"
+34 SET ABMFROM=0
+35 FOR
SET ABMFROM=$ORDER(^TMP("ABM-UCR",$JOB,ABMUO,ABMFROM))
IF +ABMFROM=0
QUIT
Begin DoDot:2
+36 WRITE !?5,ABMFROM
+37 ;S ABMST=$G(^TMP("ABM-UCR",$J,ABMUO,ABMFROM)) ;abm*2.6*1 NO HEAT
+38 ;abm*2.6*1 NO HEAT
WRITE " - "_$PIECE($GET(^TMP("ABM-UCR",$JOB,ABMUO,ABMFROM)),U,2)_" "
+39 ;abm*2.6*1 NO HEAT
SET ABMST=$PIECE($GET(^TMP("ABM-UCR",$JOB,ABMUO,ABMFROM)),U)
+40 SET ABMST=$SELECT(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",ABMST="S":"RE-OPENED",1:"TRANSMITTED")
+41 WRITE ?20,"(",ABMST,")"
End DoDot:2
End DoDot:1
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
+42 QUIT
HD DO PAZ^ABMDRUTL
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
HDB SET ABM("PG")=ABM("PG")+1
SET ABM("I")=""
DO WHD^ABMURHD
+1 QUIT
+2 ;start new code abm*2.6*1 NO HEAT
CALC ;
+1 ;user doesn't have any sessions ;abm*2.6*1 NO HEAT
IF '$DATA(ABMZ(ABMUO))
QUIT
ABILLS SET ABMABAVG=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
+1 SET ABMABTOT=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","AMT"))/+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","AB","CNT"),1)
CBILLS SET ABMCBAVG=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
+1 SET ABMCBTOT=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","AMT"))/+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CB","CNT"),1)
CCLMS SET ABMCCAVG=+$GET(^TMP("ABM-UCR",$JOB,ABMUO,"TOT","CC","CNT"))/(ABMZ(ABMUO,"ABMTDAYS"))
+1 ;convert days to hours
SET ABMSAVG=$PIECE(ABMZ(ABMUO,"ABMTDAYS"),".")*24
+2 ;convert hours to minutes
SET ABMSAVG=(ABMSAVG+($EXTRACT($PIECE(ABMZ(ABMUO,"ABMTDAYS"),".",2),1,2)))*60
+3 ;add remaining minutes
SET ABMSAVG=ABMSAVG+$EXTRACT($PIECE(ABMZ(ABMUO,"ABMTDAYS"),".",2),3,4)
+4 ;seconds as decimal
SET ABMSAVG=ABMSAVG_"."_$EXTRACT($PIECE(ABMZ(ABMUO,"ABMTDAYS"),".",2),5,6)
+5 ;divide by number of sessions
SET ABMSAVG=ABMSAVG/(+$GET(ABMZ(ABMUO,"SCNT"),1))
+6 ;convert back to hours/mins
SET ABMSAVG=ABMSAVG/60
+7 QUIT
+8 ;end new code NO HEAT