- IBOUNP4 ;ALB/CJM - INPATIENT INSURANCE REPORT ;JAN 25,1992
- ;;2.0;INTEGRATED BILLING;**528**;21-MAR-94;Build 163
- ;;Per VA Directive 6402, this routine should not be modified.
- ; VAUTD =1 if all divisions selected
- ; VAUTD() - list of selected divisions
- ; IBOEND - end of the date range for the report
- ; IBOBEG - start of the date range for report
- ; IBOUK =1 if vets whose insurance is unknown should be included
- ; IBOUI =1 if vets that are no insured should be included
- ; IBOEXP = 1 if vets whose insurance is expiring should be included
- ; IBOBYWRD = 1 if report should be sorted by ward, = 0 otherwise
- ; IBOUT = "E" if output should be in Excel format, = "R" otherwise
- MAIN ;
- N QUIT S QUIT=0,IBOBYWRD=0 K ^TMP($J)
- D DIVISION,PICK:'QUIT,CATGRY:'QUIT,SORTBY:'QUIT
- ;
- S IBOUT=$$OUT G:IBOUT="" EXIT
- ;
- D:'$G(QUIT) DEVICE
- G:QUIT EXIT
- QUEUED ; entry point if queued
- D LOOP^IBOUNP5,REPORT^IBOUNP6
- EXIT ;
- K ^TMP($J)
- I $D(ZTQUEUED) S ZTREQ="@" Q
- D ^%ZISC
- K IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTD,IBOPICK,IBOBYWRD,IBOUT
- Q
- DRANGE ; select a date range for report
- S DIR(0)="D^::EX",DIR("A")="Start with DATE" D ^DIR I $D(DIRUT) S QUIT=1 K DIR Q
- S IBOBEG=Y,DIR("A")="Go to DATE" F D ^DIR S:$D(DIRUT) QUIT=1 Q:(Y>IBOBEG)!(Y=IBOBEG)!QUIT W !,*7,"ENDING DATE must follow or be the same as the STARTING DATE"
- S IBOEND=Y K DIR Q
- DEVICE ;
- I $D(ZTQUEUED) Q
- I IBOUT="R" W !!,*7,"*** Margin width of this output is 132 ***"
- W !,"*** This output should be queued ***"
- S %ZIS="MQ" D ^%ZIS I POP S QUIT=1 Q
- I $D(IO("Q")) S ZTRTN="QUEUED^IBOUNP4",ZTIO=ION,ZTSAVE("VA*")="",ZTSAVE("IBO*")="",ZTDESC="INPATIENT INSURANCE REPORT" D ^%ZTLOAD W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED") D HOME^%ZIS S QUIT=1 Q
- U IO
- Q
- CATGRY ; allows user to select categories to include in report
- S DIR(0)="Y",DIR("A")="Include veterans whose insurance is unknown"
- S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
- S IBOUK=Y
- S DIR(0)="Y",DIR("A")="Include veterans whose insurance is expiring"
- S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
- S IBOEXP=Y
- S DIR(0)="Y",DIR("A")="Include veterans who have no insurance"
- S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
- S IBOUI=Y
- Q
- DIVISION ; gets list of selected divisions,or sets VAUTC=1 if all select
- N VAUTNI S VAUTNI=2,QUIT=1
- D DIVISION^VAUTOMA Q:Y<0
- S QUIT=0
- Q
- PICK ; gets user's choice of all current inpatients or all admitted in range
- S DIR(0)="S^D:(D)ATE RANGE;C:(C)URRENT DATE;"
- S DIR("?",1)="C for CURRENT DATE- Report will display only those patients that are "
- S DIR("?",2)="inpatients in hospital today."
- S DIR("?",3)=""
- S DIR("?",4)="D for DATE RANGE - to display all patients that were admitted "
- S DIR("?")="to the hospital during that period."
- S DIR("A")="Display report for"
- D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
- S IBOPICK=Y D:IBOPICK="D" DRANGE
- Q
- SORTBY ;sets IBOBYWRD=1 if user wants the output sorted by ward
- K DIR S DIR(0)="Y",DIR("A")="Do you want the report sorted by WARD, as well as by division and patient"
- D ^DIR I $D(DIRUT) S QUIT=1 Q
- S IBOBYWRD=Y
- Q
- ;
- OUT() ;
- 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) Q ""
- Q Y
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBOUNP4 3338 printed Feb 18, 2025@23:52:48 Page 2
- IBOUNP4 ;ALB/CJM - INPATIENT INSURANCE REPORT ;JAN 25,1992
- +1 ;;2.0;INTEGRATED BILLING;**528**;21-MAR-94;Build 163
- +2 ;;Per VA Directive 6402, this routine should not be modified.
- +3 ; VAUTD =1 if all divisions selected
- +4 ; VAUTD() - list of selected divisions
- +5 ; IBOEND - end of the date range for the report
- +6 ; IBOBEG - start of the date range for report
- +7 ; IBOUK =1 if vets whose insurance is unknown should be included
- +8 ; IBOUI =1 if vets that are no insured should be included
- +9 ; IBOEXP = 1 if vets whose insurance is expiring should be included
- +10 ; IBOBYWRD = 1 if report should be sorted by ward, = 0 otherwise
- +11 ; IBOUT = "E" if output should be in Excel format, = "R" otherwise
- MAIN ;
- +1 NEW QUIT
- SET QUIT=0
- SET IBOBYWRD=0
- KILL ^TMP($JOB)
- +2 DO DIVISION
- if 'QUIT
- DO PICK
- if 'QUIT
- DO CATGRY
- if 'QUIT
- DO SORTBY
- +3 ;
- +4 SET IBOUT=$$OUT
- if IBOUT=""
- GOTO EXIT
- +5 ;
- +6 if '$GET(QUIT)
- DO DEVICE
- +7 if QUIT
- GOTO EXIT
- QUEUED ; entry point if queued
- +1 DO LOOP^IBOUNP5
- DO REPORT^IBOUNP6
- EXIT ;
- +1 KILL ^TMP($JOB)
- +2 IF $DATA(ZTQUEUED)
- SET ZTREQ="@"
- QUIT
- +3 DO ^%ZISC
- +4 KILL IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTD,IBOPICK,IBOBYWRD,IBOUT
- +5 QUIT
- DRANGE ; select a date range for report
- +1 SET DIR(0)="D^::EX"
- SET DIR("A")="Start with DATE"
- DO ^DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- KILL DIR
- QUIT
- +2 SET IBOBEG=Y
- SET DIR("A")="Go to DATE"
- FOR
- DO ^DIR
- if $DATA(DIRUT)
- SET QUIT=1
- if (Y>IBOBEG)!(Y=IBOBEG)!QUIT
- QUIT
- WRITE !,*7,"ENDING DATE must follow or be the same as the STARTING DATE"
- +3 SET IBOEND=Y
- KILL DIR
- QUIT
- DEVICE ;
- +1 IF $DATA(ZTQUEUED)
- QUIT
- +2 IF IBOUT="R"
- WRITE !!,*7,"*** Margin width of this output is 132 ***"
- +3 WRITE !,"*** This output should be queued ***"
- +4 SET %ZIS="MQ"
- DO ^%ZIS
- IF POP
- SET QUIT=1
- QUIT
- +5 IF $DATA(IO("Q"))
- SET ZTRTN="QUEUED^IBOUNP4"
- SET ZTIO=ION
- SET ZTSAVE("VA*")=""
- SET ZTSAVE("IBO*")=""
- SET ZTDESC="INPATIENT INSURANCE REPORT"
- DO ^%ZTLOAD
- WRITE !,$SELECT($DATA(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
- DO HOME^%ZIS
- SET QUIT=1
- QUIT
- +6 USE IO
- +7 QUIT
- CATGRY ; allows user to select categories to include in report
- +1 SET DIR(0)="Y"
- SET DIR("A")="Include veterans whose insurance is unknown"
- +2 SET DIR("B")="YES"
- DO ^DIR
- KILL DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- QUIT
- +3 SET IBOUK=Y
- +4 SET DIR(0)="Y"
- SET DIR("A")="Include veterans whose insurance is expiring"
- +5 SET DIR("B")="YES"
- DO ^DIR
- KILL DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- QUIT
- +6 SET IBOEXP=Y
- +7 SET DIR(0)="Y"
- SET DIR("A")="Include veterans who have no insurance"
- +8 SET DIR("B")="YES"
- DO ^DIR
- KILL DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- QUIT
- +9 SET IBOUI=Y
- +10 QUIT
- DIVISION ; gets list of selected divisions,or sets VAUTC=1 if all select
- +1 NEW VAUTNI
- SET VAUTNI=2
- SET QUIT=1
- +2 DO DIVISION^VAUTOMA
- if Y<0
- QUIT
- +3 SET QUIT=0
- +4 QUIT
- PICK ; gets user's choice of all current inpatients or all admitted in range
- +1 SET DIR(0)="S^D:(D)ATE RANGE;C:(C)URRENT DATE;"
- +2 SET DIR("?",1)="C for CURRENT DATE- Report will display only those patients that are "
- +3 SET DIR("?",2)="inpatients in hospital today."
- +4 SET DIR("?",3)=""
- +5 SET DIR("?",4)="D for DATE RANGE - to display all patients that were admitted "
- +6 SET DIR("?")="to the hospital during that period."
- +7 SET DIR("A")="Display report for"
- +8 DO ^DIR
- KILL DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- QUIT
- +9 SET IBOPICK=Y
- if IBOPICK="D"
- DO DRANGE
- +10 QUIT
- SORTBY ;sets IBOBYWRD=1 if user wants the output sorted by ward
- +1 KILL DIR
- SET DIR(0)="Y"
- SET DIR("A")="Do you want the report sorted by WARD, as well as by division and patient"
- +2 DO ^DIR
- IF $DATA(DIRUT)
- SET QUIT=1
- QUIT
- +3 SET IBOBYWRD=Y
- +4 QUIT
- +5 ;
- OUT() ;
- +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)
- QUIT ""
- +7 QUIT Y