ABMRDNYD ; IHS/SD/SDR - Bill Status Report ;
;;2.6;IHS 3P BILLING SYSTEM;**21**;NOV 12, 2009;Build 379
; IHS/SD/SDR - 2.6*21 - HEAT241429 - New Report
;
K ABM,ABMY
S ABM("RFOR")=1 ;printer or comma-delimited
S ABM("RFOR","NM")="Printer"
S ABM("PG")=0
S ABM("DNYDT")=""
;
SEL ;
S ABM("NODX")=""
S ABM("NOSTAT")=""
D ^ABMDRSEL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
S ABM("HD",0)="Bill Status Report"
D ^ABMDRHD
S ABMQ("RC")="COMPUTE^ABMRDNYD"
S ABMQ("RX")="POUT^ABMDRUTL"
S ABMQ("NS")="ABM"
S ABMQ("RP")="PRINT^ABMRDNY"_ABM("RFOR")
D ^ABMDRDBQ
Q
;
COMPUTE ;EP - Entry Point for Setting up Data
S ABM("SUBR")="ABM-RDNY"
K ^TMP("ABM-RDNY",$J)
SLOOP ;
I $D(ABMY("DT")) D Q
.S ABM("RD")=ABMY("DT",1)-1
.F S ABM("RD")=$O(^ABMDBILL(DUZ(2),"AD",ABM("RD"))) Q:'+ABM("RD")!(ABM("RD")>ABMY("DT",2)) D
..S ABM=""
..F S ABM=$O(^ABMDBILL(DUZ(2),"AD",ABM("RD"),ABM)) Q:'ABM D DATA
;LOOP THROUGH STATUS
S ABM("RD")=0
F S ABM("RD")=$O(^ABMDBILL(DUZ(2),"AD",ABM("RD"))) Q:'ABM("RD") D
.S ABM=""
.F S ABM=$O(^ABMDBILL(DUZ(2),"AD",ABM("RD"),ABM)) Q:'ABM D DATA
Q
;
DATA ;
S ABMP("HIT")=0
D BILL^ABMDRCHK Q:'ABMP("HIT")
I '$D(ABMY("PRV")) D
.S ABMT=$O(^ABMDBILL(DUZ(2),ABM,41,"C","A",0))
.I +ABMT=0 S ABMT=$O(^ABMDBILL(DUZ(2),ABM,41,"C","R",0))
.I +ABMT=0 S ABMT("PRV")="NO PROVIDER"
.I +ABMT>0 S ABMT("PRV")=$$GET1^DIQ(200,$P($G(^ABMDBILL(DUZ(2),ABM,41,ABMT,0)),U),".01","E")
I $D(ABMY("PRV")) S ABMT("PRV")=$$GET1^DIQ(200,ABMY("PRV"),".01","E")
S ^TMP("ABM-RDNY",$J,ABMT("PRV"),ABM)=""
Q
ABMRDNYD ; IHS/SD/SDR - Bill Status Report ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**21**;NOV 12, 2009;Build 379
+2 ; IHS/SD/SDR - 2.6*21 - HEAT241429 - New Report
+3 ;
+4 KILL ABM,ABMY
+5 ;printer or comma-delimited
SET ABM("RFOR")=1
+6 SET ABM("RFOR","NM")="Printer"
+7 SET ABM("PG")=0
+8 SET ABM("DNYDT")=""
+9 ;
SEL ;
+1 SET ABM("NODX")=""
+2 SET ABM("NOSTAT")=""
+3 DO ^ABMDRSEL
IF $DATA">DATA">DATA">DATA(DTOUT)!$DATA">DATA">DATA">DATA(DUOUT)!$DATA">DATA">DATA">DATA(DIROUT)
QUIT
+4 SET ABM("HD",0)="Bill Status Report"
+5 DO ^ABMDRHD
+6 SET ABMQ("RC")="COMPUTE^ABMRDNYD"
+7 SET ABMQ("RX")="POUT^ABMDRUTL"
+8 SET ABMQ("NS")="ABM"
+9 SET ABMQ("RP")="PRINT^ABMRDNY"_ABM("RFOR")
+10 DO ^ABMDRDBQ
+11 QUIT
+12 ;
COMPUTE ;EP - Entry Point for Setting up Data
+1 SET ABM("SUBR")="ABM-RDNY"
+2 KILL ^TMP("ABM-RDNY",$JOB)
SLOOP ;
+1 IF $DATA(ABMY("DT"))
Begin DoDot:1
+2 SET ABM("RD")=ABMY("DT",1)-1
+3 FOR
SET ABM("RD")=$ORDER(^ABMDBILL(DUZ(2),"AD",ABM("RD")))
IF '+ABM("RD")!(ABM("RD")>ABMY("DT",2))
QUIT
Begin DoDot:2
+4 SET ABM=""
+5 FOR
SET ABM=$ORDER(^ABMDBILL(DUZ(2),"AD",ABM("RD"),ABM))
IF 'ABM
QUIT
DO DATA
End DoDot:2
End DoDot:1
QUIT
+6 ;LOOP THROUGH STATUS
+7 SET ABM("RD")=0
+8 FOR
SET ABM("RD")=$ORDER(^ABMDBILL(DUZ(2),"AD",ABM("RD")))
IF 'ABM("RD")
QUIT
Begin DoDot:1
+9 SET ABM=""
+10 FOR
SET ABM=$ORDER(^ABMDBILL(DUZ(2),"AD",ABM("RD"),ABM))
IF 'ABM
QUIT
DO DATA
End DoDot:1
+11 QUIT
+12 ;
DATA ;
+1 SET ABMP("HIT")=0
+2 DO BILL^ABMDRCHK
IF 'ABMP("HIT")
QUIT
+3 IF '$DATA(ABMY("PRV"))
Begin DoDot:1
+4 SET ABMT=$ORDER(^ABMDBILL(DUZ(2),ABM,41,"C","A",0))
+5 IF +ABMT=0
SET ABMT=$ORDER(^ABMDBILL(DUZ(2),ABM,41,"C","R",0))
+6 IF +ABMT=0
SET ABMT("PRV")="NO PROVIDER"
+7 IF +ABMT>0
SET ABMT("PRV")=$$GET1^DIQ(200,$PIECE($GET(^ABMDBILL(DUZ(2),ABM,41,ABMT,0)),U),".01","E")
End DoDot:1
+8 IF $DATA(ABMY("PRV"))
SET ABMT("PRV")=$$GET1^DIQ(200,ABMY("PRV"),".01","E")
+9 SET ^TMP("ABM-RDNY",$JOB,ABMT("PRV"),ABM)=""
+10 QUIT