Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBOUNP4

IBOUNP4.m

Go to the documentation of this file.
  1. IBOUNP4 ;ALB/CJM - INPATIENT INSURANCE REPORT ;JAN 25,1992
  1. ;;2.0;INTEGRATED BILLING;**528**;21-MAR-94;Build 163
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ; VAUTD =1 if all divisions selected
  1. ; VAUTD() - list of selected divisions
  1. ; IBOEND - end of the date range for the report
  1. ; IBOBEG - start of the date range for report
  1. ; IBOUK =1 if vets whose insurance is unknown should be included
  1. ; IBOUI =1 if vets that are no insured should be included
  1. ; IBOEXP = 1 if vets whose insurance is expiring should be included
  1. ; IBOBYWRD = 1 if report should be sorted by ward, = 0 otherwise
  1. ; IBOUT = "E" if output should be in Excel format, = "R" otherwise
  1. MAIN ;
  1. N QUIT S QUIT=0,IBOBYWRD=0 K ^TMP($J)
  1. D DIVISION,PICK:'QUIT,CATGRY:'QUIT,SORTBY:'QUIT
  1. ;
  1. S IBOUT=$$OUT G:IBOUT="" EXIT
  1. ;
  1. D:'$G(QUIT) DEVICE
  1. G:QUIT EXIT
  1. QUEUED ; entry point if queued
  1. D LOOP^IBOUNP5,REPORT^IBOUNP6
  1. EXIT ;
  1. K ^TMP($J)
  1. I $D(ZTQUEUED) S ZTREQ="@" Q
  1. D ^%ZISC
  1. K IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTD,IBOPICK,IBOBYWRD,IBOUT
  1. Q
  1. DRANGE ; select a date range for report
  1. S DIR(0)="D^::EX",DIR("A")="Start with DATE" D ^DIR I $D(DIRUT) S QUIT=1 K DIR Q
  1. 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"
  1. S IBOEND=Y K DIR Q
  1. DEVICE ;
  1. I $D(ZTQUEUED) Q
  1. I IBOUT="R" W !!,*7,"*** Margin width of this output is 132 ***"
  1. W !,"*** This output should be queued ***"
  1. S %ZIS="MQ" D ^%ZIS I POP S QUIT=1 Q
  1. 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
  1. U IO
  1. Q
  1. CATGRY ; allows user to select categories to include in report
  1. S DIR(0)="Y",DIR("A")="Include veterans whose insurance is unknown"
  1. S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
  1. S IBOUK=Y
  1. S DIR(0)="Y",DIR("A")="Include veterans whose insurance is expiring"
  1. S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
  1. S IBOEXP=Y
  1. S DIR(0)="Y",DIR("A")="Include veterans who have no insurance"
  1. S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
  1. S IBOUI=Y
  1. Q
  1. DIVISION ; gets list of selected divisions,or sets VAUTC=1 if all select
  1. N VAUTNI S VAUTNI=2,QUIT=1
  1. D DIVISION^VAUTOMA Q:Y<0
  1. S QUIT=0
  1. Q
  1. PICK ; gets user's choice of all current inpatients or all admitted in range
  1. S DIR(0)="S^D:(D)ATE RANGE;C:(C)URRENT DATE;"
  1. S DIR("?",1)="C for CURRENT DATE- Report will display only those patients that are "
  1. S DIR("?",2)="inpatients in hospital today."
  1. S DIR("?",3)=""
  1. S DIR("?",4)="D for DATE RANGE - to display all patients that were admitted "
  1. S DIR("?")="to the hospital during that period."
  1. S DIR("A")="Display report for"
  1. D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
  1. S IBOPICK=Y D:IBOPICK="D" DRANGE
  1. Q
  1. SORTBY ;sets IBOBYWRD=1 if user wants the output sorted by ward
  1. K DIR S DIR(0)="Y",DIR("A")="Do you want the report sorted by WARD, as well as by division and patient"
  1. D ^DIR I $D(DIRUT) S QUIT=1 Q
  1. S IBOBYWRD=Y
  1. Q
  1. ;
  1. OUT() ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^E:Excel;R:Report"
  1. S DIR("A")="(E)xcel Format or (R)eport Format: "
  1. S DIR("B")="Report"
  1. D ^DIR I $D(DIRUT) Q ""
  1. Q Y