IBJDB1 ;ALB/CPM - BILLING LAG TIME REPORT ; 27-DEC-96
;;2.0;INTEGRATED BILLING;**69,80,100,118,165**;21-MAR-94
;
EN ; - Option entry point.
;
W !!,"This report measures the amount of time between significant"
W !,"milestones which occur from the time treatment has been provided"
W !,"to the time that the claim to the insurer for that treatment has"
W !,"been closed out.",!
;
DATE D DATE^IBOUTL I IBBDT=""!(IBEDT="") G ENQ
;
; - Sort by division.
S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Do you wish to sort this report by division"
S DIR("?")="^D HLP1^IBJDB1" W !
D ^DIR K DIR I $D(DIRUT)!$D(DTOUT)!$D(DUOUT)!$D(DIROUT) G ENQ
S IBSORT=+Y K DIROUT,DTOUT,DUOUT,DIRUT
;
; - Issue prompt for division.
I IBSORT D PSDR^IBODIV G:Y<0 ENQ
;
; - Select a Detailed or Summary report.
DS D DS^IBJD I "^"[IBRPT G ENQ
I IBRPT="S" S IBSEL=",1,2,3,4,5,6,7,8,9,10,11," G DEV
;
SEL ; - Select main report or line item reports.
W ! S DIR(0)="LO^1:11^K:+$P(X,""-"",2)>11 X"
F X=1:1:11 S DIR("A",X)=$S(X<10:" ",1:"")_X_" - Print "_$$TITLE(X,1)
S DIR("A",12)="",DIR("A")="Select",DIR("B")=1
S DIR("?")="^D HLP2^IBJDB1" D ^DIR K DIR G:Y["^" ENQ S IBSEL=Y
S DIR(0)="Y",DIR("A",1)="You have selected"
I IBSEL="1,2,3,4,5,6,7,8,9,10,11," D
.S DIR("A",1)=DIR("A",1)_" ALL the above reports."
E F X=1:1 S X1=$P(IBSEL,",",X) Q:'X1 S DIR("A",X+1)=" "_$$TITLE(X1,1)
S DIR("A")="Are you sure",DIR("B")="NO"
W ! D ^DIR K DIR G ENQ:Y["^",SEL:'Y S IBSEL=","_IBSEL
;
DEV W !!,"This report only requires an 80 column printer."
;
W !!,"Note: This report searches through all Reimb. Insurance claims."
W !?6,"You should queue this report to run after normal business hours."
;
; - Select a device.
W ! S %ZIS="QM" D ^%ZIS G:POP ENQ
I $D(IO("Q")) D G ENQ
.S ZTRTN="DQ^IBJDB1",ZTDESC="IB - BILLING LAG TIME REPORT"
.F X="IB*","VAUTD","VAUTD(" S ZTSAVE(X)=""
.D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"Unable to queue this job.")
.K ZTSK,IO("Q") D HOME^%ZIS
;
U IO
;
DQ ; - Tasked entry point.
;
I $G(IBXTRACT) D E^IBJDE(10,1) ; Change extract status.
;
K IBCT,IBTL,^TMP("IBJDB1",$J)
S IBQ=0 D ^IBJDB11 I IBQ G ENQ ; Compile data for reports.
;
; - Extract summary data.
I $G(IBXTRACT) D G ENQ
.S X=0 F Y=1:1:4,9,10,11,"2I","3I","4I" D
..S X=X+1,IB(X)=$J($S('IBCT(0,"OP",Y):0,1:IBTL(0,"OP",Y)/IBCT(0,"OP",Y)),0,2)
.F Y=5:1:11,"6I","7I","8I" D
..S X=X+1,IB(X)=$J($S('IBCT(0,"IN",Y):0,1:IBTL(0,"IN",Y)/IBCT(0,"IN",Y)),0,2)
.D E^IBJDE(10,0)
;
; - Print the reports.
S IBQ=0
S IBDIV="" F S IBDIV=$S(IBRPT="D":$O(^TMP("IBJDB1",$J,IBDIV)),1:$O(IBCT(IBDIV))) Q:IBDIV="" D Q:IBQ
.S IBPAG=0 D NOW^%DTC S IBRUN=$$DAT2^IBOUTL(%)
.I IBRPT="D" D OPT^IBJDB12 I 'IBQ D INP^IBJDB13
.I IBRPT="S" D SUM^IBJDB12
;
ENQ K ^TMP("IBJDB1",$J)
I $D(ZTQUEUED) S ZTREQ="@" G ENQ1
;
D ^%ZISC
ENQ1 K IB,IBBDT,IBBN,IBEDT,IBCK,IBN,IBN0,IBRPT,IBPAG,IBQ,IBRUN,IBX,IBX1,IBX2
K IBX3,IBAUTH,IBDAT,IBDFN,IBNU,IBPTF,IBPOL,IBPOL1,IBTY,IBS,IBSEL,IBSEL1
K IBCT,IBDIV,IBSORT,IBTL,IBCHK,IBDCHK,DFN,POP,VAUTD,ZTDESC,ZTRTN,ZTSAVE
K IBDR,IBH,DIROUT,DTOUT,DUOUT,DIRUT,%,%ZIS,D,X,X1,X2,Y,Y1,Z,Z1,Z2,Z3
Q
;
HLP1 ; - 'Sort by Division?' prompt.
W !?1,"Enter a <CR> to print the report without regard to division,"
W !?1,"or 'Y' to select those divisions for which a separate report"
W !?1,"should be created. To quit this option, enter '^'."
Q
;
HLP2 ; - Line item report prompt.
W !?1,"Select '1-11' (Response can be a single number, list or range,"
W !?1,"e.g.: 1,3,5 or 2-6,10) to print up to 11 lag time reports based"
W !?1,"on the line items of the lag time summary reports. To quit this"
W !?1,"option, enter '^'."
Q
;
TITLE(X,Y) ; - Display/print report titles.
Q $P($T(TITLE1+X),";;",2)_$S(Y:$P($T(TITLE1+X),";;",3),1:"")
;
TITLE1 ; - Line item titles.
;;Date of Care to Date of Check Out;; (Outpatient claims)
;;Date of Check Out to Date Claim Authorized;; (Outpatient claims)
;;Date of Care to Date of First Payment;; (Outpatient claims)
;;Date of Care to Date Receivable Closed;; (Outpatient claims)
;;Date of Discharge to Date PTF Transmitted;; (Inpatient claims)
;;Date PTF Transmitted to Date Claim Authorized;; (Inpatient claims)
;;Date of Discharge to Date of First Payment;; (Inpatient claims)
;;Date of Discharge to Date Receivable Closed;; (Inpatient claims)
;;Date Claim Authorized to Date Claim Activated
;;Date Claim Activated to Date of First Payment
;;Date of First Payment to Date Receivable Closed
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBJDB1 4600 printed Nov 22, 2024@17:32:38 Page 2
IBJDB1 ;ALB/CPM - BILLING LAG TIME REPORT ; 27-DEC-96
+1 ;;2.0;INTEGRATED BILLING;**69,80,100,118,165**;21-MAR-94
+2 ;
EN ; - Option entry point.
+1 ;
+2 WRITE !!,"This report measures the amount of time between significant"
+3 WRITE !,"milestones which occur from the time treatment has been provided"
+4 WRITE !,"to the time that the claim to the insurer for that treatment has"
+5 WRITE !,"been closed out.",!
+6 ;
DATE DO DATE^IBOUTL
IF IBBDT=""!(IBEDT="")
GOTO ENQ
+1 ;
+2 ; - Sort by division.
+3 SET DIR(0)="Y"
SET DIR("B")="NO"
+4 SET DIR("A")="Do you wish to sort this report by division"
+5 SET DIR("?")="^D HLP1^IBJDB1"
WRITE !
+6 DO ^DIR
KILL DIR
IF $DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO ENQ
+7 SET IBSORT=+Y
KILL DIROUT,DTOUT,DUOUT,DIRUT
+8 ;
+9 ; - Issue prompt for division.
+10 IF IBSORT
DO PSDR^IBODIV
if Y<0
GOTO ENQ
+11 ;
+12 ; - Select a Detailed or Summary report.
DS DO DS^IBJD
IF "^"[IBRPT
GOTO ENQ
+1 IF IBRPT="S"
SET IBSEL=",1,2,3,4,5,6,7,8,9,10,11,"
GOTO DEV
+2 ;
SEL ; - Select main report or line item reports.
+1 WRITE !
SET DIR(0)="LO^1:11^K:+$P(X,""-"",2)>11 X"
+2 FOR X=1:1:11
SET DIR("A",X)=$SELECT(X<10:" ",1:"")_X_" - Print "_$$TITLE(X,1)
+3 SET DIR("A",12)=""
SET DIR("A")="Select"
SET DIR("B")=1
+4 SET DIR("?")="^D HLP2^IBJDB1"
DO ^DIR
KILL DIR
if Y["^"
GOTO ENQ
SET IBSEL=Y
+5 SET DIR(0)="Y"
SET DIR("A",1)="You have selected"
+6 IF IBSEL="1,2,3,4,5,6,7,8,9,10,11,"
Begin DoDot:1
+7 SET DIR("A",1)=DIR("A",1)_" ALL the above reports."
End DoDot:1
+8 IF '$TEST
FOR X=1:1
SET X1=$PIECE(IBSEL,",",X)
if 'X1
QUIT
SET DIR("A",X+1)=" "_$$TITLE(X1,1)
+9 SET DIR("A")="Are you sure"
SET DIR("B")="NO"
+10 WRITE !
DO ^DIR
KILL DIR
if Y["^"
GOTO ENQ
if 'Y
GOTO SEL
SET IBSEL=","_IBSEL
+11 ;
DEV WRITE !!,"This report only requires an 80 column printer."
+1 ;
+2 WRITE !!,"Note: This report searches through all Reimb. Insurance claims."
+3 WRITE !?6,"You should queue this report to run after normal business hours."
+4 ;
+5 ; - Select a device.
+6 WRITE !
SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO ENQ
+7 IF $DATA(IO("Q"))
Begin DoDot:1
+8 SET ZTRTN="DQ^IBJDB1"
SET ZTDESC="IB - BILLING LAG TIME REPORT"
+9 FOR X="IB*","VAUTD","VAUTD("
SET ZTSAVE(X)=""
+10 DO ^%ZTLOAD
WRITE !!,$SELECT($DATA(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"Unable to queue this job.")
+11 KILL ZTSK,IO("Q")
DO HOME^%ZIS
End DoDot:1
GOTO ENQ
+12 ;
+13 USE IO
+14 ;
DQ ; - Tasked entry point.
+1 ;
+2 ; Change extract status.
IF $GET(IBXTRACT)
DO E^IBJDE(10,1)
+3 ;
+4 KILL IBCT,IBTL,^TMP("IBJDB1",$JOB)
+5 ; Compile data for reports.
SET IBQ=0
DO ^IBJDB11
IF IBQ
GOTO ENQ
+6 ;
+7 ; - Extract summary data.
+8 IF $GET(IBXTRACT)
Begin DoDot:1
+9 SET X=0
FOR Y=1:1:4,9,10,11,"2I","3I","4I"
Begin DoDot:2
+10 SET X=X+1
SET IB(X)=$JUSTIFY($SELECT('IBCT(0,"OP",Y):0,1:IBTL(0,"OP",Y)/IBCT(0,"OP",Y)),0,2)
End DoDot:2
+11 FOR Y=5:1:11,"6I","7I","8I"
Begin DoDot:2
+12 SET X=X+1
SET IB(X)=$JUSTIFY($SELECT('IBCT(0,"IN",Y):0,1:IBTL(0,"IN",Y)/IBCT(0,"IN",Y)),0,2)
End DoDot:2
+13 DO E^IBJDE(10,0)
End DoDot:1
GOTO ENQ
+14 ;
+15 ; - Print the reports.
+16 SET IBQ=0
+17 SET IBDIV=""
FOR
SET IBDIV=$SELECT(IBRPT="D":$ORDER(^TMP("IBJDB1",$JOB,IBDIV)),1:$ORDER(IBCT(IBDIV)))
if IBDIV=""
QUIT
Begin DoDot:1
+18 SET IBPAG=0
DO NOW^%DTC
SET IBRUN=$$DAT2^IBOUTL(%)
+19 IF IBRPT="D"
DO OPT^IBJDB12
IF 'IBQ
DO INP^IBJDB13
+20 IF IBRPT="S"
DO SUM^IBJDB12
End DoDot:1
if IBQ
QUIT
+21 ;
ENQ KILL ^TMP("IBJDB1",$JOB)
+1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
GOTO ENQ1
+2 ;
+3 DO ^%ZISC
ENQ1 KILL IB,IBBDT,IBBN,IBEDT,IBCK,IBN,IBN0,IBRPT,IBPAG,IBQ,IBRUN,IBX,IBX1,IBX2
+1 KILL IBX3,IBAUTH,IBDAT,IBDFN,IBNU,IBPTF,IBPOL,IBPOL1,IBTY,IBS,IBSEL,IBSEL1
+2 KILL IBCT,IBDIV,IBSORT,IBTL,IBCHK,IBDCHK,DFN,POP,VAUTD,ZTDESC,ZTRTN,ZTSAVE
+3 KILL IBDR,IBH,DIROUT,DTOUT,DUOUT,DIRUT,%,%ZIS,D,X,X1,X2,Y,Y1,Z,Z1,Z2,Z3
+4 QUIT
+5 ;
HLP1 ; - 'Sort by Division?' prompt.
+1 WRITE !?1,"Enter a <CR> to print the report without regard to division,"
+2 WRITE !?1,"or 'Y' to select those divisions for which a separate report"
+3 WRITE !?1,"should be created. To quit this option, enter '^'."
+4 QUIT
+5 ;
HLP2 ; - Line item report prompt.
+1 WRITE !?1,"Select '1-11' (Response can be a single number, list or range,"
+2 WRITE !?1,"e.g.: 1,3,5 or 2-6,10) to print up to 11 lag time reports based"
+3 WRITE !?1,"on the line items of the lag time summary reports. To quit this"
+4 WRITE !?1,"option, enter '^'."
+5 QUIT
+6 ;
TITLE(X,Y) ; - Display/print report titles.
+1 QUIT $PIECE($TEXT(TITLE1+X),";;",2)_$SELECT(Y:$PIECE($TEXT(TITLE1+X),";;",3),1:"")
+2 ;
TITLE1 ; - Line item titles.
+1 ;;Date of Care to Date of Check Out;; (Outpatient claims)
+2 ;;Date of Check Out to Date Claim Authorized;; (Outpatient claims)
+3 ;;Date of Care to Date of First Payment;; (Outpatient claims)
+4 ;;Date of Care to Date Receivable Closed;; (Outpatient claims)
+5 ;;Date of Discharge to Date PTF Transmitted;; (Inpatient claims)
+6 ;;Date PTF Transmitted to Date Claim Authorized;; (Inpatient claims)
+7 ;;Date of Discharge to Date of First Payment;; (Inpatient claims)
+8 ;;Date of Discharge to Date Receivable Closed;; (Inpatient claims)
+9 ;;Date Claim Authorized to Date Claim Activated
+10 ;;Date Claim Activated to Date of First Payment
+11 ;;Date of First Payment to Date Receivable Closed