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

IBOUNP1.m

Go to the documentation of this file.
  1. IBOUNP1 ;ALB/CJM - OUTPATIENT INSURANCE REPORT ;JAN 25,1992
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ; VAUTD =1 if all divisions selected
  1. ; VAUTD() - list of selected divisions
  1. ; VAUTC =1 if all clinics selected in selected divisions
  1. ; VAUTC() - list of selected clinics, indexed by record number
  1. ; IBOEND - end of the date range for the report
  1. ; IBOBEG - start of the date range for report
  1. ; IBOQUIT - flag to exit
  1. ; IBOUK =1 if vets whose insurance is unknow 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. MAIN ;
  1. ;***
  1. ;S XRTL=$ZU(0),XRTN="IBOUNP1-1" D T0^%ZOSV ;start rt clock
  1. ;
  1. S IBOQUIT=0 K ^TMP($J)
  1. D CLINIC,CATGRY:'IBOQUIT,DRANGE:'IBOQUIT
  1. D:'IBOQUIT DEVICE
  1. G:IBOQUIT EXIT
  1. QUEUED ; entry point if queued
  1. ;***
  1. ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP1" D T1^%ZOSV ;stop rt clock
  1. ;S XRTL=$ZU(0),XRTN="IBOUNP1-2" D T0^%ZOSV ;start rt clock
  1. ;
  1. D:'IBOQUIT LCLINIC,LOOPCLNC^IBOUNP2,REPORT^IBOUNP3
  1. EXIT ;
  1. K ^TMP($J)
  1. ;***
  1. ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOUNP1" D T1^%ZOSV ;stop rt clock
  1. ;
  1. I $D(ZTQUEUED) S ZTREQ="@" Q
  1. D ^%ZISC
  1. K IBOQUIT,IBOBEG,IBOEND,IBOUK,IBOUI,IBOEXP,VAUTC,VAUTD
  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 IBOQUIT=1 K DIR Q
  1. S IBOBEG=Y,DIR("A")="Go to DATE" F D ^DIR S:$D(DIRUT) IBOQUIT=1 Q:(Y>IBOBEG)!(Y=IBOBEG)!IBOQUIT W !,*7,"ENDING DATE must follow or be the same as the STARTING DATE"
  1. S IBOEND=Y K DIR
  1. Q
  1. DEVICE ;
  1. I $D(ZTQUEUED) Q
  1. 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 IBOQUIT=1 Q
  1. I $D(IO("Q")) S ZTRTN="QUEUED^IBOUNP1",ZTIO=ION,ZTSAVE("VA*")="",ZTSAVE("IBO*")="",ZTDESC="OUTPATIENT INSURANCE REPORT" D ^%ZTLOAD W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED") D HOME^%ZIS S IBOQUIT=1 Q
  1. U IO Q
  1. CLINIC ; gets list of selected clinics,or sets VAUTC=1 if all selected
  1. N VAUTNI S VAUTNI=2,IBOQUIT=1
  1. D DIVISION^VAUTOMA Q:Y<0 S VAUTNI=2 D CLINIC^VAUTOMA Q:Y<0
  1. S IBOQUIT=0 Q
  1. LCLINIC ; lists clinics if not all divisions were chosen
  1. N IBCLN,NODE
  1. I VAUTD'=1&(VAUTC=1) S VAUTC=0,IBCLN="" F S IBCLN=$O(^SC(IBCLN)) Q:IBCLN="" D
  1. .S NODE=$G(^SC(IBCLN,0))
  1. .;make sure it's the one of selected divisions division
  1. .Q:'$D(VAUTD(+$P(NODE,"^",15)))
  1. .;check that location is a clinic
  1. .Q:$P(NODE,"^",3)'="C"
  1. .S VAUTC(IBCLN)=""
  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 IBOQUIT=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 IBOQUIT=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 IBOQUIT=1 Q
  1. S IBOUI=Y
  1. Q