IBJDB2 ;ALB/RB - REASONS NOT BILLABLE REPORT (INPUT);19-JUN-00
;;2.0;INTEGRATED BILLING;**123,185**;21-MAR-94
;
; - Sort by division.
S IBSD=$$SDIV^IBJD() I IBSD["^" G ENQ
;
GDR ; - Get specific date range.
W !!,"Run report for (D)ATE ENTERED or (E)PISODE DATE: D// "
R X:DTIME G:'$T!(X["^") ENQ S X=$S(X="":"D",1:$E(X))
I "DdEe"'[X D HELP1 G GDR
S IBD=$S("Dd"[X:"DATE ENTERED",1:"EPISODE DATE") W " ",IBD
S DIR(0)="DA^:DT:EX",DIR("A")=" Start with "_IBD_": ",DIR("T")=DTIME
D ^DIR K DIR G:$D(DIRUT)!$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ENQ
S IBBDT=+Y K DIROUT,DTOUT,DUOUT,DIRUT
S DIR(0)="DA^"_IBBDT_":DT:EX"
S DIR("A")=" Go to "_IBD_": ",DIR("T")=DTIME
D ^DIR K DIR G:$D(DIRUT)!$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ENQ
S IBEDT=+Y K DIROUT,DTOUT,DUOUT,DIRUT
;
; - Get ALL/Specific reasons not billable.
D ALSP^IBJD("Reasons Not Billable^Reason Not Billable","^IBE(356.8,",.IBSRNB)
I IBSRNB["^" G ENQ
;
; - Get ALL/Specific Providers
D ALSP^IBJD("Providers^Provider","^VA(200,",.IBSPRV)
I IBSPRV["^" G ENQ
;
DS ; - Select a detailed or summary report.
D DS^IBJD G:IBRPT["^" ENQ
;
SEL ; - Select episode to print.
S IBPRT="Choose which episode to print:"
K IBEPS
S IBEPS(1)="INPATIENT"
S IBEPS(2)="OUTPATIENT"
S IBEPS(3)="PROSTHETICS"
S IBEPS(4)="PHARMACY"
S IBEPS(5)="ALL RECEIVABLES"
S IBSEL=$$MLTP^IBJD(IBPRT,.IBEPS,1) I 'IBSEL G ENQ
;
; - Get ALL/Specific Inpatient Specialties
I IBSEL["1" D I IBSISP["^" G ENQ
. D ALSP^IBJD("Inpatient Specialties^Inpatient Specialty","^DIC(45.7,",.IBSISP)
;
; - Get ALL/Specific Outpatient Specialties
I IBSEL["2" D I IBSOSP["^" G ENQ
. D ALSP^IBJD("Outpatient Specialties^Outpatient Specialty","^DIC(40.7,",.IBSOSP)
;
I IBRPT="S" G DEV
;
RPS ; - Sort by RNB category/specialty/provider, if necessary.
S IBSORT="R" G:IBSEL'[1&(IBSEL'[2) EXCEL
W !!,"Sort report by (R)NB CATEGORY, (P)ROVIDER, or (S)PECIALTY: R// "
R X:DTIME G:'$T!(X["^") ENQ S X=$S(X="":"R",1:$E(X))
I "RrPpSs"'[X D HELP2 G RPS
W " ",$S("Pp"[X:"PROVIDER","Ss"[X:"SPECIALTY",1:"RNB CATEGORY")
S IBSORT=X
;
EXCEL ; - Determine whether to gather data for Excel report.
S IBEXCEL=$$EXCEL^IBJD() G ENQ:IBEXCEL="^"
;
DEV ; - Select a device.
I '$G(IBEXCEL) D
. S X=$S(IBRPT="S":80,1:132)
. W !!,"You will need a ",X," column printer for this report!",!
. W !,"Note: This report may take a while to run. You should queue it"
. W !," to run after normal business hours.",!
;
I $G(IBEXCEL) D EXMSG^IBJD
;
S %ZIS="QM" D ^%ZIS G:POP ENQ
I $D(IO("Q")) D G ENQ
.S ZTRTN="DQ^IBJDB2",ZTDESC="IB - REASONS NOT BILLABLE REPORT"
.F I="IB*","IBSRNB(","VAUTD","VAUTD(" S ZTSAVE(I)=""
.D ^%ZTLOAD
.I $D(ZTSK) W !!,"This job has been queued. Task number is "_ZTSK_"."
.E W !!,"Unable to queue this job."
.K I,IO("Q"),ZTSK D HOME^%ZIS
;
U IO
;
DQ ; - Tasked entry point.
;
; If called by the Extraction Module, change extract status for the 4
; reports: Reasons not Billable Inpatient, Outpatient, Prosthetics and
; Pharmacy.
I $G(IBXTRACT) F I=25:1:36 D E^IBJDE(I,1)
;
D ^IBJDB21 ; Compile and print report.
;
ENQ K ^TMP("IBJDB2",$J)
I $D(ZTQUEUED) S ZTREQ="@" G ENQ1
D ^%ZISC
ENQ1 K IBBDT,IBCLK,IBD,IBEDT,IBEPD,IBEPS,IBEXCEL,IBPRT,IBRPT,IBSD,IBSEL
K IBSORT,IBSISP,IBSOSP,IBSPRV,IBSRNB
K POP,VAUTD,ZTDESC,ZTRTN,ZTSAVE,%ZIS,I,X,Y,%
Q
;
HELP1 ; - 'Run report by (D)ATE ENTERED...' prompt.
W !!?6,"Enter: '<CR>' - To enter a DATE ENTERED range for the report"
W !?16,"'E' - To enter a EPISODE DATE range for the report"
W !?16,"'^' - To quit this option"
Q
;
HELP2 ; - 'Sort report by (R)NB CATEGORY...' prompt.
W !!?6,"Enter: '<CR>' - To sort detail report by RNB category"
W !?16,"'P' - To sort detail report by provider"
W !?16,"'S' - To sort detail report by specialty"
W !?16,"'^' - To quit this option"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBJDB2 3906 printed Dec 13, 2024@02:22:38 Page 2
IBJDB2 ;ALB/RB - REASONS NOT BILLABLE REPORT (INPUT);19-JUN-00
+1 ;;2.0;INTEGRATED BILLING;**123,185**;21-MAR-94
+2 ;
+3 ; - Sort by division.
+4 SET IBSD=$$SDIV^IBJD()
IF IBSD["^"
GOTO ENQ
+5 ;
GDR ; - Get specific date range.
+1 WRITE !!,"Run report for (D)ATE ENTERED or (E)PISODE DATE: D// "
+2 READ X:DTIME
if '$TEST!(X["^")
GOTO ENQ
SET X=$SELECT(X="":"D",1:$EXTRACT(X))
+3 IF "DdEe"'[X
DO HELP1
GOTO GDR
+4 SET IBD=$SELECT("Dd"[X:"DATE ENTERED",1:"EPISODE DATE")
WRITE " ",IBD
+5 SET DIR(0)="DA^:DT:EX"
SET DIR("A")=" Start with "_IBD_": "
SET DIR("T")=DTIME
+6 DO ^DIR
KILL DIR
if $DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO ENQ
+7 SET IBBDT=+Y
KILL DIROUT,DTOUT,DUOUT,DIRUT
+8 SET DIR(0)="DA^"_IBBDT_":DT:EX"
+9 SET DIR("A")=" Go to "_IBD_": "
SET DIR("T")=DTIME
+10 DO ^DIR
KILL DIR
if $DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO ENQ
+11 SET IBEDT=+Y
KILL DIROUT,DTOUT,DUOUT,DIRUT
+12 ;
+13 ; - Get ALL/Specific reasons not billable.
+14 DO ALSP^IBJD("Reasons Not Billable^Reason Not Billable","^IBE(356.8,",.IBSRNB)
+15 IF IBSRNB["^"
GOTO ENQ
+16 ;
+17 ; - Get ALL/Specific Providers
+18 DO ALSP^IBJD("Providers^Provider","^VA(200,",.IBSPRV)
+19 IF IBSPRV["^"
GOTO ENQ
+20 ;
DS ; - Select a detailed or summary report.
+1 DO DS^IBJD
if IBRPT["^"
GOTO ENQ
+2 ;
SEL ; - Select episode to print.
+1 SET IBPRT="Choose which episode to print:"
+2 KILL IBEPS
+3 SET IBEPS(1)="INPATIENT"
+4 SET IBEPS(2)="OUTPATIENT"
+5 SET IBEPS(3)="PROSTHETICS"
+6 SET IBEPS(4)="PHARMACY"
+7 SET IBEPS(5)="ALL RECEIVABLES"
+8 SET IBSEL=$$MLTP^IBJD(IBPRT,.IBEPS,1)
IF 'IBSEL
GOTO ENQ
+9 ;
+10 ; - Get ALL/Specific Inpatient Specialties
+11 IF IBSEL["1"
Begin DoDot:1
+12 DO ALSP^IBJD("Inpatient Specialties^Inpatient Specialty","^DIC(45.7,",.IBSISP)
End DoDot:1
IF IBSISP["^"
GOTO ENQ
+13 ;
+14 ; - Get ALL/Specific Outpatient Specialties
+15 IF IBSEL["2"
Begin DoDot:1
+16 DO ALSP^IBJD("Outpatient Specialties^Outpatient Specialty","^DIC(40.7,",.IBSOSP)
End DoDot:1
IF IBSOSP["^"
GOTO ENQ
+17 ;
+18 IF IBRPT="S"
GOTO DEV
+19 ;
RPS ; - Sort by RNB category/specialty/provider, if necessary.
+1 SET IBSORT="R"
if IBSEL'[1&(IBSEL'[2)
GOTO EXCEL
+2 WRITE !!,"Sort report by (R)NB CATEGORY, (P)ROVIDER, or (S)PECIALTY: R// "
+3 READ X:DTIME
if '$TEST!(X["^")
GOTO ENQ
SET X=$SELECT(X="":"R",1:$EXTRACT(X))
+4 IF "RrPpSs"'[X
DO HELP2
GOTO RPS
+5 WRITE " ",$SELECT("Pp"[X:"PROVIDER","Ss"[X:"SPECIALTY",1:"RNB CATEGORY")
+6 SET IBSORT=X
+7 ;
EXCEL ; - Determine whether to gather data for Excel report.
+1 SET IBEXCEL=$$EXCEL^IBJD()
if IBEXCEL="^"
GOTO ENQ
+2 ;
DEV ; - Select a device.
+1 IF '$GET(IBEXCEL)
Begin DoDot:1
+2 SET X=$SELECT(IBRPT="S":80,1:132)
+3 WRITE !!,"You will need a ",X," column printer for this report!",!
+4 WRITE !,"Note: This report may take a while to run. You should queue it"
+5 WRITE !," to run after normal business hours.",!
End DoDot:1
+6 ;
+7 IF $GET(IBEXCEL)
DO EXMSG^IBJD
+8 ;
+9 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO ENQ
+10 IF $DATA(IO("Q"))
Begin DoDot:1
+11 SET ZTRTN="DQ^IBJDB2"
SET ZTDESC="IB - REASONS NOT BILLABLE REPORT"
+12 FOR I="IB*","IBSRNB(","VAUTD","VAUTD("
SET ZTSAVE(I)=""
+13 DO ^%ZTLOAD
+14 IF $DATA(ZTSK)
WRITE !!,"This job has been queued. Task number is "_ZTSK_"."
+15 IF '$TEST
WRITE !!,"Unable to queue this job."
+16 KILL I,IO("Q"),ZTSK
DO HOME^%ZIS
End DoDot:1
GOTO ENQ
+17 ;
+18 USE IO
+19 ;
DQ ; - Tasked entry point.
+1 ;
+2 ; If called by the Extraction Module, change extract status for the 4
+3 ; reports: Reasons not Billable Inpatient, Outpatient, Prosthetics and
+4 ; Pharmacy.
+5 IF $GET(IBXTRACT)
FOR I=25:1:36
DO E^IBJDE(I,1)
+6 ;
+7 ; Compile and print report.
DO ^IBJDB21
+8 ;
ENQ KILL ^TMP("IBJDB2",$JOB)
+1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
GOTO ENQ1
+2 DO ^%ZISC
ENQ1 KILL IBBDT,IBCLK,IBD,IBEDT,IBEPD,IBEPS,IBEXCEL,IBPRT,IBRPT,IBSD,IBSEL
+1 KILL IBSORT,IBSISP,IBSOSP,IBSPRV,IBSRNB
+2 KILL POP,VAUTD,ZTDESC,ZTRTN,ZTSAVE,%ZIS,I,X,Y,%
+3 QUIT
+4 ;
HELP1 ; - 'Run report by (D)ATE ENTERED...' prompt.
+1 WRITE !!?6,"Enter: '<CR>' - To enter a DATE ENTERED range for the report"
+2 WRITE !?16,"'E' - To enter a EPISODE DATE range for the report"
+3 WRITE !?16,"'^' - To quit this option"
+4 QUIT
+5 ;
HELP2 ; - 'Sort report by (R)NB CATEGORY...' prompt.
+1 WRITE !!?6,"Enter: '<CR>' - To sort detail report by RNB category"
+2 WRITE !?16,"'P' - To sort detail report by provider"
+3 WRITE !?16,"'S' - To sort detail report by specialty"
+4 WRITE !?16,"'^' - To quit this option"
+5 QUIT