IBCNERPO ;AITC/CKB - PATIENT POLICY AUTOLOAD REPORT ; 20-JAN-2026
;;2.0;INTEGRATED BILLING;**836**;21-MAR-94;Build 12
;;Per VA Directive 6402, this routine should not be modified.
;
; Variables:
; IBCNERPO("BEGDT") = Start with DATE - start date range
; IBCNERPO("ENDDT") = Go to DATE - end date range
; IBCNERPO("IBOUT") = "R" for Report format or "E" for Excel format
; IBCNERPO("TYPE") = report type: "S" - summary, "D" - detailed
; IBCNERPO("SORT") = (1)Patient Name - (2)Date Autoloaded
;
Q
EN ; entry point
N IBCNERPO,STOP,TYPE
;
S STOP=0
W @IOF
W !,"Patient Policy Autoload Report"
W !!,"This report provides data for patient Medicare Policies that have been"
W !,"Autoloaded by the eIV Autoload Process.",!
;
DATE ; Date Range parameters
D DTRANGE I STOP G EXIT
;
; Report Type - Summary or Detailed
TYPE ;Type of Report
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
W !
S DIR(0)="SA^S:Summary;D:Detailed"
S DIR("A")="Do you wish to print a (S)ummary or (D)etailed Report? "
D ^DIR
I $D(DIRUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1
I STOP G EXIT
S (TYPE,IBCNERPO("TYPE"))=Y
; If Summary report is selected, DO NOT prompt for report format or sort
I TYPE="S" W !! G DEVICE
;
IBOUT ;
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
W !
S DIR(0)="SA^E:Excel;R:Report"
S DIR("A")="(E)xcel Format or (R)eport Format: "
S DIR("B")="Report"
D ^DIR I $D(DIRUT) S STOP=1
I STOP G EXIT
S IBCNERPO("IBOUT")=Y
;
SORT ;
I TYPE="D"&(IBCNERPO("IBOUT")="R") D I STOP=1 G EXIT ;;*****G:$$STOP EXIT
. W !
. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
. S DIR("A",1)="Sort report by"
. S DIR("A",2)="1 - Patient Name"
. S DIR("A",3)="2 - Date Autoloaded"
. S DIR("A",4)=" "
. S DIR(0)="SAB^1:Patient Name;2:Date Autoloaded"
. S DIR("A")="Select Number: "
. D ^DIR
. I $D(DIRUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1
. I STOP G EXIT
. S IBCNERPO("SORT")=Y
;
I IBCNERPO("IBOUT")="E" D
. W !!,"For CSV output, turn logging or capture on now. To avoid undesired wrapping"
. W !,"of the data saved to the file, please enter ""0;256;99999"" at the ""DEVICE:"""
. W !,"prompt.",!
I $G(IBCNERPO("TYPE"))="D" I $G(IBCNERPO("IBOUT"))="R" D
. W !!!,"*** You will need a 132 column printer for this report. ***",!
. W "To avoid undesired wrapping of the data when printing to the screen,",!
. W "please enter ""0;132;"" at the ""DEVICE:"" prompt.",!
;
; Select the output device
DEVICE ; Device Handler and possible TaskManager calls
; Output params: STOP = Flag to stop routine
;
; Init vars
N POP,ZTDESC,ZTRTN,ZTSAVE
S ZTRTN="COMPILE^IBCNERPO(.IBCNERPO)"
S ZTDESC="Patient Policy Autoload Report"
S ZTSAVE("IBCNERPO(")=""
D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"QM",1)
EXIT ;
Q
;
COMPILE(IBCNERPO) ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
; Input params:
; IBCNERPO = Array passed by ref of the report params
;
; Init scratch globals
K ^TMP($J,"IBCNERPO")
N IBOUT
S IBOUT=$G(IBCNERPO("IBOUT"))
; Compile
D EN^IBCNERPO1(.IBCNERPO)
; Print
I '$G(ZTSTOP) D PRINT^IBCNERPO1(.IBCNERPO)
; Close device
D ^%ZISC
; Kill scratch globals
K ^TMP($J,"IBCNERPO")
; Purge task record
I $D(ZTQUEUED) S ZTREQ="@"
COMPILX ; COMPILE exit pt
Q
;
;
DTRANGE ;
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,IBDT180
DT10 ; Start with DATE - default is 6 months (or 180 days)in the past
W !
S IBDT180=$$FMADD^XLFDT($$DT^XLFDT(),-180)
S DIR(0)="D^::EX"
S DIR("B")=$$FMTE^XLFDT(IBDT180,"D")
S DIR("A")="Start with DATE"
S DIR("?",1)="Please enter a valid date no more than 6 months in the past."
S DIR("?")="Future dates are not allowed."
D ^DIR I $D(DIRUT) S STOP=1 Q
I (Y>DT)!(Y<IBDT180) D G DT10
. W !!,"Please enter a valid date no more than 6 months in the past."
. W !,"Future dates are not allowed."
S IBCNERPO("BEGDT")=Y
;
DT20 ; Go to DATE - no default
K DIR("A"),DIR("B")
S DIR("A")="Go to DATE"
S DIR("?",1)="Please enter a valid date no more than 6 months in the past."
S DIR("?")="Future dates are not allowed."
D ^DIR
I $D(DIRUT) S STOP=1 Q
;
I Y>DT D G DT20
. W !!,"Please enter a valid date no more than 6 months in the past."
. W !,"Future dates are not allowed.",!
I Y<IBCNERPO("BEGDT") W !!,"Go to DATE must not precede the Start with DATE.",! G DT20
S IBCNERPO("ENDDT")=Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCNERPO 4423 printed Sep 17, 2026@21:01:41 Page 2
IBCNERPO ;AITC/CKB - PATIENT POLICY AUTOLOAD REPORT ; 20-JAN-2026
+1 ;;2.0;INTEGRATED BILLING;**836**;21-MAR-94;Build 12
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; Variables:
+5 ; IBCNERPO("BEGDT") = Start with DATE - start date range
+6 ; IBCNERPO("ENDDT") = Go to DATE - end date range
+7 ; IBCNERPO("IBOUT") = "R" for Report format or "E" for Excel format
+8 ; IBCNERPO("TYPE") = report type: "S" - summary, "D" - detailed
+9 ; IBCNERPO("SORT") = (1)Patient Name - (2)Date Autoloaded
+10 ;
+11 QUIT
EN ; entry point
+1 NEW IBCNERPO,STOP,TYPE
+2 ;
+3 SET STOP=0
+4 WRITE @IOF
+5 WRITE !,"Patient Policy Autoload Report"
+6 WRITE !!,"This report provides data for patient Medicare Policies that have been"
+7 WRITE !,"Autoloaded by the eIV Autoload Process.",!
+8 ;
DATE ; Date Range parameters
+1 DO DTRANGE
IF STOP
GOTO EXIT
+2 ;
+3 ; Report Type - Summary or Detailed
TYPE ;Type of Report
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+2 WRITE !
+3 SET DIR(0)="SA^S:Summary;D:Detailed"
+4 SET DIR("A")="Do you wish to print a (S)ummary or (D)etailed Report? "
+5 DO ^DIR
+6 IF $DATA(DIRUT)!$DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
+7 IF STOP
GOTO EXIT
+8 SET (TYPE,IBCNERPO("TYPE"))=Y
+9 ; If Summary report is selected, DO NOT prompt for report format or sort
+10 IF TYPE="S"
WRITE !!
GOTO DEVICE
+11 ;
IBOUT ;
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+2 WRITE !
+3 SET DIR(0)="SA^E:Excel;R:Report"
+4 SET DIR("A")="(E)xcel Format or (R)eport Format: "
+5 SET DIR("B")="Report"
+6 DO ^DIR
IF $DATA(DIRUT)
SET STOP=1
+7 IF STOP
GOTO EXIT
+8 SET IBCNERPO("IBOUT")=Y
+9 ;
SORT ;
+1 ;;*****G:$$STOP EXIT
IF TYPE="D"&(IBCNERPO("IBOUT")="R")
Begin DoDot:1
+2 WRITE !
+3 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+4 SET DIR("A",1)="Sort report by"
+5 SET DIR("A",2)="1 - Patient Name"
+6 SET DIR("A",3)="2 - Date Autoloaded"
+7 SET DIR("A",4)=" "
+8 SET DIR(0)="SAB^1:Patient Name;2:Date Autoloaded"
+9 SET DIR("A")="Select Number: "
+10 DO ^DIR
+11 IF $DATA(DIRUT)!$DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
+12 IF STOP
GOTO EXIT
+13 SET IBCNERPO("SORT")=Y
End DoDot:1
IF STOP=1
GOTO EXIT
+14 ;
+15 IF IBCNERPO("IBOUT")="E"
Begin DoDot:1
+16 WRITE !!,"For CSV output, turn logging or capture on now. To avoid undesired wrapping"
+17 WRITE !,"of the data saved to the file, please enter ""0;256;99999"" at the ""DEVICE:"""
+18 WRITE !,"prompt.",!
End DoDot:1
+19 IF $GET(IBCNERPO("TYPE"))="D"
IF $GET(IBCNERPO("IBOUT"))="R"
Begin DoDot:1
+20 WRITE !!!,"*** You will need a 132 column printer for this report. ***",!
+21 WRITE "To avoid undesired wrapping of the data when printing to the screen,",!
+22 WRITE "please enter ""0;132;"" at the ""DEVICE:"" prompt.",!
End DoDot:1
+23 ;
+24 ; Select the output device
DEVICE ; Device Handler and possible TaskManager calls
+1 ; Output params: STOP = Flag to stop routine
+2 ;
+3 ; Init vars
+4 NEW POP,ZTDESC,ZTRTN,ZTSAVE
+5 SET ZTRTN="COMPILE^IBCNERPO(.IBCNERPO)"
+6 SET ZTDESC="Patient Policy Autoload Report"
+7 SET ZTSAVE("IBCNERPO(")=""
+8 DO EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"QM",1)
EXIT ;
+1 QUIT
+2 ;
COMPILE(IBCNERPO) ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
+1 ; Input params:
+2 ; IBCNERPO = Array passed by ref of the report params
+3 ;
+4 ; Init scratch globals
+5 KILL ^TMP($JOB,"IBCNERPO")
+6 NEW IBOUT
+7 SET IBOUT=$GET(IBCNERPO("IBOUT"))
+8 ; Compile
+9 DO EN^IBCNERPO1(.IBCNERPO)
+10 ; Print
+11 IF '$GET(ZTSTOP)
DO PRINT^IBCNERPO1(.IBCNERPO)
+12 ; Close device
+13 DO ^%ZISC
+14 ; Kill scratch globals
+15 KILL ^TMP($JOB,"IBCNERPO")
+16 ; Purge task record
+17 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
COMPILX ; COMPILE exit pt
+1 QUIT
+2 ;
+3 ;
DTRANGE ;
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,IBDT180
DT10 ; Start with DATE - default is 6 months (or 180 days)in the past
+1 WRITE !
+2 SET IBDT180=$$FMADD^XLFDT($$DT^XLFDT(),-180)
+3 SET DIR(0)="D^::EX"
+4 SET DIR("B")=$$FMTE^XLFDT(IBDT180,"D")
+5 SET DIR("A")="Start with DATE"
+6 SET DIR("?",1)="Please enter a valid date no more than 6 months in the past."
+7 SET DIR("?")="Future dates are not allowed."
+8 DO ^DIR
IF $DATA(DIRUT)
SET STOP=1
QUIT
+9 IF (Y>DT)!(Y<IBDT180)
Begin DoDot:1
+10 WRITE !!,"Please enter a valid date no more than 6 months in the past."
+11 WRITE !,"Future dates are not allowed."
End DoDot:1
GOTO DT10
+12 SET IBCNERPO("BEGDT")=Y
+13 ;
DT20 ; Go to DATE - no default
+1 KILL DIR("A"),DIR("B")
+2 SET DIR("A")="Go to DATE"
+3 SET DIR("?",1)="Please enter a valid date no more than 6 months in the past."
+4 SET DIR("?")="Future dates are not allowed."
+5 DO ^DIR
+6 IF $DATA(DIRUT)
SET STOP=1
QUIT
+7 ;
+8 IF Y>DT
Begin DoDot:1
+9 WRITE !!,"Please enter a valid date no more than 6 months in the past."
+10 WRITE !,"Future dates are not allowed.",!
End DoDot:1
GOTO DT20
+11 IF Y<IBCNERPO("BEGDT")
WRITE !!,"Go to DATE must not precede the Start with DATE.",!
GOTO DT20
+12 SET IBCNERPO("ENDDT")=Y
+13 QUIT