IBOUNP4 ;ALB/CJM - INPATIENT INSURANCE REPORT ;JAN 25,1992
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
; 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 unknow 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
MAIN ;
;***
;S XRTL=$ZU(0),XRTN="IBOUNP4-1" D T0^%ZOSV ;start rt clock
;
N QUIT S QUIT=0,IBOBYWRD=0 K ^TMP($J)
D DIVISION,PICK:'QUIT,CATGRY:'QUIT,SORTBY:'QUIT
D:'$G(QUIT) DEVICE
G:QUIT EXIT
QUEUED ; entry point if queued
;***
;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP4" D T1^%ZOSV ;stop rt clock
;S XRTL=$ZU(0),XRTN="IBOUNP4-2" D T0^%ZOSV ;start rt clock
;
D LOOP^IBOUNP5,REPORT^IBOUNP6
EXIT ;
K ^TMP($J)
;***
;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP4" D T1^%ZOSV ;stop rt clock
;
I $D(ZTQUEUED) S ZTREQ="@" Q
D ^%ZISC
K IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTD,IBOPICK,IBOBYWRD
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
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
IBOUNP4 ;ALB/CJM - INPATIENT INSURANCE REPORT ;JAN 25,1992
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ; VAUTD =1 if all divisions selected
+3 ; VAUTD() - list of selected divisions
+4 ; IBOEND - end of the date range for the report
+5 ; IBOBEG - start of the date range for report
+6 ; IBOUK =1 if vets whose insurance is unknow should be included
+7 ; IBOUI =1 if vets that are no insured should be included
+8 ; IBOEXP = 1 if vets whose insurance is expiring should be included
+9 ; IBOBYWRD = 1 if report should be sorted by ward, = 0 otherwise
MAIN ;
+1 ;***
+2 ;S XRTL=$ZU(0),XRTN="IBOUNP4-1" D T0^%ZOSV ;start rt clock
+3 ;
+4 NEW QUIT
SET QUIT=0
SET IBOBYWRD=0
KILL ^TMP($JOB)
+5 DO DIVISION
IF 'QUIT
DO PICK
IF 'QUIT
DO CATGRY
IF 'QUIT
DO SORTBY
+6 IF '$GET(QUIT)
DO DEVICE
+7 IF QUIT
GOTO EXIT
QUEUED ; entry point if queued
+1 ;***
+2 ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP4" D T1^%ZOSV ;stop rt clock
+3 ;S XRTL=$ZU(0),XRTN="IBOUNP4-2" D T0^%ZOSV ;start rt clock
+4 ;
+5 DO LOOP^IBOUNP5
DO REPORT^IBOUNP6
EXIT ;
+1 KILL ^TMP($JOB)
+2 ;***
+3 ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP4" D T1^%ZOSV ;stop rt clock
+4 ;
+5 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+6 DO ^%ZISC
+7 KILL IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTD,IBOPICK,IBOBYWRD
+8 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 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