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

IBCNGP.m

Go to the documentation of this file.
  1. IBCNGP ;ALB/CKB - REPORT OF COVERAGE LIMITATIONS (MAIN DRIVER/PROMPTS) ; 07-OCT-2021
  1. ;;2.0;INTEGRATED BILLING;**702**;21-MAR-94;Build 53
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; ICR #1519-For using the KERNEL routine XUTMDEVQ
  1. ;
  1. ; Prompt user to select report type, insurance companies, plans
  1. ; Output from User Selections:
  1. ; IBCNGP("IBOUT") E-EXCEL, R-REPORT
  1. ; IBCNGP("IBI") 0-Selected, 1-All Insurance Companies
  1. ; IBCNGP("IBIA") 0-Inactive, 1-Active, 2-Both Active and Inactive Insurance Companies
  1. ; IBCNGP("IBIP") 0-Selected, 1-All Group Plans
  1. ; IBCNGP("IBIPA") 0-Inactive, 1-Active, 2-Both Active and Inactive Group Plans
  1. ; IBCNGP("IBIGN") 1-Group Name, 2-Group Number, 3-Both Group Name and Group Number
  1. ; IBCNGP("IBFIL") A^B^C where"
  1. ; A - 1-Begin with, 2-Contains, 3-Range
  1. ; B - A=1 Begin with text, A=2 Contains text, A=3 Range start text
  1. ; C - only if A=3 Range End text
  1. ; IBCNGP("IBICS") 1-Covered, 2-Not Covered, 3-Conditional
  1. ; 4-By Default (blank status), 5-All Coverage Statuses
  1. ;
  1. Q ; Must call EN
  1. ;
  1. EN ;Main Entry point
  1. ; Initialize variables
  1. N A,DIRUT,DIROUT,DUOUT,DTOUT,FILTER,GIEN,I,IBCNGP,IBCNGPRTN,IBQUIT,IIEN,INACT
  1. N NGFLG,NGFND,POP,STOP,X,Y,ZTDESC,ZTDEXC,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE,ZTSTOP,%ZIS
  1. K ^TMP("IBCNGP",$J)
  1. S (IBQUIT,STOP)=0
  1. S IBCNGPRTN="IBCNGP"
  1. ;
  1. ; Describe report
  1. W @IOF
  1. W !,"Coverage Limitations Report",!
  1. W !,"This report will generate a list of coverage limitations by company and"
  1. W !,"group. You must select one, multiple, or all insurance companies and anywhere"
  1. W !,"from one to all of the plans under each company. The results can be filtered"
  1. W !,"by coverage limitation status."
  1. ;
  1. C10 ; All/Selected Insurance Companies
  1. D SELI I STOP G EXIT
  1. ;
  1. C20 ; Inactive/Active/Both Insurance Company look-up filter
  1. D SELA I STOP G EXIT
  1. ;
  1. C30 ; Insurance Company look-up listman template
  1. ; Allow user selection of Insurance Companies
  1. I 'IBCNGP("IBI") D
  1. . N IBCNS,INSCT,INSNAME
  1. . D EN^IBCNILK(IBCNGP("IBIA"))
  1. . I '$D(^TMP("IBCNILKA",$J)) S IBQUIT=1 Q ; No Insurance Companies selected
  1. . S INSCT=0
  1. . S IBCNS="" F S IBCNS=$O(^TMP("IBCNILKA",$J,IBCNS)) Q:IBCNS="" D
  1. . . S INSCT=INSCT+1
  1. . . ; Add SELECTED Insurance Companies, add to ^TMP("IBCNGP")
  1. . . S ^TMP("IBCNGP",$J,"INS",INSCT)=IBCNS
  1. . K ^TMP("IBCNILKA",$J)
  1. ;
  1. I IBQUIT W !!,"** No Insurance Companies selected! **",!! S DIR(0)="E" D ^DIR K DIR G EXIT
  1. ;
  1. ; If ALL Insurance Companies, add to ^TMP("IBCNGP")
  1. I IBCNGP("IBI") D
  1. . S INSCT=0
  1. . S IIEN=0 F S IIEN=$O(^DIC(36,IIEN)) Q:'IIEN D
  1. . . ; Is the Insurance Company Inactive?
  1. . . S INACT=+$$GET1^DIQ(36,IIEN_",",.05,"I") ;1=Inactive, 0=Active
  1. . . I 'INACT,'IBCNGP("IBIA") Q ; Ins Company is Active and looking for Inactive only
  1. . . I INACT,(IBCNGP("IBIA")=1) Q ; Ins Company is Inactive and looking for Active only
  1. . . S INSCT=INSCT+1
  1. . . S ^TMP("IBCNGP",$J,"INS",INSCT)=IIEN
  1. ;
  1. G10 ; All/Selected Group Plans
  1. D SELG I STOP G EXIT
  1. ; No Groups found (NGFND=1), type enter to continue and exit
  1. I $G(NGFND)=1 S DIR(0)="E" D ^DIR K DIR G EXIT
  1. ;
  1. G20 ; Inactive/Active/Both Group Plan filter
  1. D SELGA I STOP G EXIT
  1. ;
  1. G30 ; Group Name/Group Number/Both filter
  1. D SELGN I STOP G EXIT
  1. ;
  1. G40 ; Group(s)that Begin/Contain/Range XXX
  1. S FILTER=$$SELFILT^IBCNGP()
  1. I +FILTER<0 S STOP=1 I STOP G EXIT
  1. S IBCNGP("IBFIL")=FILTER
  1. ;
  1. ; Obtain Groups Plans for selected or All Insurance Companies
  1. D START
  1. I '$D(^TMP("IBCNGP",$J,"INS")) W !!,"** No plans selected! **",!! S DIR(0)="E" D ^DIR K DIR G EXIT
  1. I STOP G EXIT
  1. ;
  1. G50 ; Group Coverage Status filter
  1. D SELCS I STOP G EXIT
  1. ;
  1. O10 ; Report or CSV output
  1. D OUT I STOP G EXIT
  1. D DEVICE
  1. ;
  1. EXIT ;
  1. K ^TMP("IBCNILKA",$J)
  1. K ^TMP("IBCNGP",$J)
  1. Q
  1. ;
  1. DEVICE ;
  1. N I,POP
  1. W !!,"We recommend you queue this report as it will take awhile."
  1. I IBCNGP("IBOUT")="E" D
  1. . W !!,"For CSV output, turn logging or capture on now. To avoid undesired wrapping"
  1. . W !,"of the data saved to the file, please enter ""0;256;99999"" at the ""DEVICE:"""
  1. . W !,"prompt.",!
  1. I IBCNGP("IBOUT")="R" D
  1. . W !!,"*** You will need a 132 column printer for this report. ***",!
  1. ;
  1. ; IBCNGP = Array of Params
  1. N POP,ZTDESC,ZTRTN,ZTSAVE
  1. S ZTRTN="COMPILE^IBCNGP1(""IBCNGP"",.IBCNGP)"
  1. S ZTDESC="CV - REPORT OF COVERAGE LIMITATION"
  1. S ZTSAVE("^TMP(""IBCNGP"",$J,")=""
  1. S ZTSAVE("IBCNGP(")=""
  1. D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"Q") ; ICR # 1519
  1. ;
  1. ENQ ;
  1. K ^TMP("IBCNILKA",$J)
  1. K ^TMP("IBCNGP",$J)
  1. Q
  1. ;
  1. START ; Group Plan look-up listman template
  1. ; Allow user selection of one or more Group Plans
  1. ; Input: IBCNGP("IBIP") 0-Selected, 1-All Group Plans
  1. ; IBCNGP("IBIPA") 0-Inactive, 1-Active, 2-Both Active and Inactive Group Plans
  1. ; IBCNGP("IBIGN") 1-Group Name, 2-Group Number, 3-Both Group Name and Group Number
  1. ; IBCNGP("IBFIL") A^B^C where"
  1. ; A - 1-Begin with, 2-Contains, 3-Range
  1. ; B - A=1 Begin with text, A=2 Contains text, A=3 Range start text
  1. ; C - only if A=3 Range End text
  1. N A,B,CT,GCT,GIEN,IBCT,IBOK,IBSEL,PLANOK,SORT
  1. S IBQUIT=0
  1. ;
  1. ;If Selected Group Plans
  1. I 'IBCNGP("IBIP") D
  1. . D SORT
  1. . S CT=0
  1. . S A="" F S A=$O(SORT(A)) Q:A=""!IBQUIT D
  1. . . S B="" F S B=$O(SORT(A,B)) Q:B=""!IBQUIT D
  1. . . . D GETGRP
  1. STARTQ ;
  1. K ^TMP($J,"IBSEL")
  1. Q
  1. ;
  1. GETGRP ; Gather Group Plans by Insurance Companies
  1. S IBCT=SORT(A,B)
  1. S CT=CT+1
  1. W !!,"Insurance Company # "_CT_": "_A
  1. D OK^IBCNSM3
  1. I IBQUIT S STOP=1 Q
  1. I 'IBOK K ^TMP("IBCNGP",$J,"INS",IBCT) Q
  1. W " ...building a list of plans..."
  1. K IBSEL,^TMP($J,"IBSEL")
  1. ;
  1. ; The Groups listed will be filtered the based on the users selections above
  1. D LKP^IBCNSU21(B,1,IBCNGP("IBIPA"),IBCNGP("IBIGN"),IBCNGP("IBFIL"))
  1. I IBQUIT S STOP=1 Q
  1. I $G(^TMP($J,"IBSEL",0))=0 D
  1. . K SORT(A,B),^TMP("IBCNGP",$J,"INS",IBCT)
  1. . S IBCNGP("IBAI")=0
  1. ;
  1. ; Add SELECTED Plans, add to ^TMP("IBCNGP")
  1. I $G(^TMP($J,"IBSEL",0))>0 D
  1. . S GCT=0
  1. . S GIEN=0 F S GIEN=$O(^TMP($J,"IBSEL",GIEN)) Q:'GIEN D
  1. . . S GCT=GCT+1
  1. . . S ^TMP("IBCNGP",$J,"INS",IBCT,"GRP",GCT)=GIEN
  1. Q
  1. ;
  1. SORT ; Sort the currently selected insurance companies into name order
  1. N IBCT,IIEN,INSNAME
  1. ;
  1. S IBCT=""
  1. F S IBCT=$O(^TMP("IBCNGP",$J,"INS",IBCT)) Q:IBCT=""!IBQUIT D
  1. . S IIEN=^TMP("IBCNGP",$J,"INS",IBCT)
  1. . S INSNAME=$$GET1^DIQ(36,IIEN,.01)
  1. . ;IB*702/CKB - if the Insurance Company name doesn't exist, quit to prevent VistA crash
  1. . I INSNAME="" Q
  1. . S SORT(INSNAME,IIEN)=IBCT
  1. Q
  1. ;
  1. ;======================================Prompts==========================
  1. SELI ; Prompt user to select all or subset of insurance companies
  1. ; Count insurance companies with plans
  1. ; Returns: 0 - User selects insurance companies
  1. ; 1 - Run report for all insurance companies with plans
  1. ; STOP=1 - No selection made
  1. ;
  1. N A,B
  1. S (A,B)=0
  1. F S A=$O(^IBA(355.3,"B",A)) Q:'A S B=B+1
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^1:List All "_B_" Ins. Companies;2:List Only Ins. Companies That You Select"
  1. S DIR("A",1)="1 - List All "_B_" Ins. Companies"
  1. S DIR("A",2)="2 - List Only Ins. Companies That You Select"
  1. S DIR("A")=" SELECT 1 or 2: "
  1. S DIR("?",1)="Enter a code from the list: 1 or 2. Only insurance"
  1. S DIR("?")="companies with one or more plans can be selected."
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELIQ
  1. S IBCNGP("IBI")=(+Y=1) K Y
  1. SELIQ ;
  1. Q
  1. ;
  1. SELA ; Prompt user to select Active/Inactive/Both Insurance Companies
  1. ; Returns: 0 - INACTIVE Insurance Companies Only
  1. ; 1 - ACTIVE Insurance Companies Only
  1. ; 2 - Both ACTIVE and INACTIVE Insurance Companies
  1. ; STOP=1 - No selection made
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^1:ACTIVE;2:INACTIVE;3:BOTH"
  1. S DIR("A")=" Select 1 or 2 or 3: "
  1. S DIR("A",1)="1 - Select ACTIVE Insurance Companies"
  1. S DIR("A",2)="2 - Select INACTIVE Insurance Companies"
  1. S DIR("A",3)="3 - Select BOTH"
  1. S DIR("?",1)=" 1 - Only allow selection of ACTIVE Insurance Companies"
  1. S DIR("?",2)=" 2 - Only allow selection of INACTIVE Insurance Companies"
  1. S DIR("?")=" 3 - Allow selection of ACTIVE and INACTIVE Insurance Companies"
  1. S DIR("B")=1
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELAQ
  1. S IBCNGP("IBIA")=$S(Y=1:1,Y=2:0,1:2)
  1. SELAQ ;
  1. Q
  1. ;
  1. SELG ; Prompt user to select all or subset of group plans
  1. ; Count of group plans
  1. ; Returns: 0 - Selected Group Plans
  1. ; 1 - All Group Plans
  1. ; STOP=1 - No selection made
  1. ;
  1. N A,A0,A1,CT,INACT
  1. ;
  1. ; Get count of Group Plans from Insurance Company(s), ALL or Selected
  1. S (NGFLG,NGFND)=0
  1. S CT=0
  1. S A0=0 F S A0=$O(^TMP("IBCNGP",$J,"INS",A0)) Q:A0="" D
  1. . S A=^TMP("IBCNGP",$J,"INS",A0)
  1. . I '$D(^IBA(355.3,"B",A)) S NGFLG=1 Q
  1. . S B=0 F S B=$O(^IBA(355.3,"B",A,B)) Q:'B D
  1. . . S CT=CT+1
  1. ;
  1. ; If there are no groups for the selected Ins Company(s),display the following and set NGFND=1
  1. I 'IBCNGP("IBI"),CT=0 D Q
  1. . W !!,"The selected Company(s) does not contain any Groups",!!
  1. . S NGFND=1,IBCNGP("IBIP")=0
  1. ;
  1. ; If there are No Groups found when one or more Ins Company(s) are selected
  1. ; display the following message
  1. I NGFLG W !!,"Some Selected Companies do not contain groups and will not display on the report"
  1. ;
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^1:List All "_CT_" Group Plans;2:List Only Group Plans That You Select"
  1. S DIR("A",1)="1 - List All "_CT_" Group Plans"
  1. S DIR("A",2)="2 - List Only Group Plans That You Select"
  1. S DIR("A")=" SELECT 1 or 2: "
  1. S DIR("?",1)="Enter a code from the list: 1 or 2."
  1. S DIR("?")="One or more group plans can be selected."
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELGQ
  1. S IBCNGP("IBIP")=(+Y=1) K Y
  1. SELGQ ;
  1. Q
  1. ;
  1. SELGA ; Prompt user to select Active/Inactive/Both Group Plans
  1. ; Input: None
  1. ; Returns: 0 - INACTIVE Group Plans Only
  1. ; 1 - ACTIVE Group Plans Only
  1. ; 2 - Both ACTIVE and INACTIVE Group Plans
  1. ; -1 - No selection made
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^1:ACTIVE;2:INACTIVE;3:BOTH"
  1. S DIR("A")=" Select 1 or 2 or 3: "
  1. S DIR("A",1)="1 - Select ACTIVE Group Plans"
  1. S DIR("A",2)="2 - Select INACTIVE Group Plans"
  1. S DIR("A",3)="3 - Select BOTH"
  1. S DIR("?",1)=" 1 - Only allow selection of ACTIVE Group Plans"
  1. S DIR("?",2)=" 2 - Only allow selection of INACTIVE Group Plans"
  1. S DIR("?")=" 3 - Allow selection of ACTIVE and INACTIVE Group Plans"
  1. S DIR("B")=1
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELGAQ
  1. S IBCNGP("IBIPA")=$S(Y=1:1,Y=2:0,1:2)
  1. SELGAQ ;
  1. Q
  1. ;
  1. SELGN ; Prompt user to select Group Name/Group Number/Both filter
  1. ; Returns: 1 - Group Name
  1. ; 2 - Group Number
  1. ; 3 - Both Group Name and Group Number
  1. ; -1 - No selection made
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="SA^1:GROUP NAME;2:GROUP NUMBER;3:BOTH"
  1. S DIR("A")=" Select 1 or 2 or 3: "
  1. S DIR("A",1)="1 - Select GROUP NAME"
  1. S DIR("A",2)="2 - Select GROUP NUMBER"
  1. S DIR("A",3)="3 - Select BOTH"
  1. S DIR("?",1)=" 1 - Only allow selection of GROUP NAME"
  1. S DIR("?",2)=" 2 - Only allow selection of GROUP NUMBER"
  1. S DIR("?")=" 3 - Allow selection of GROUP NAME and GROUP NUMBER"
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELGNQ
  1. S IBCNGP("IBIGN")=Y
  1. SELGNQ ;
  1. Q
  1. ;
  1. SELFILT() ; Group Plan filter
  1. ; Returns: A^B^C Where:
  1. ; A - 1 - Search for Group(s) that begin with
  1. ; the specified text (case insensitive)
  1. ; 2 - Search for Group(s) that contain
  1. ; the specified text (case insensitive)
  1. ; 3 - Search for Group(s) in a specified
  1. ; range (inclusive, case insensitive)
  1. ; 4 - Search for Group(s) that are BLANK or null
  1. ; B - Begin with text if A=1, Contains Text if A=2 or
  1. ; the range start if A=3
  1. ; C - Range End text (only present when A=3)
  1. ; -1 if a valid filter was not selected
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,FILTER,X,XX,Y
  1. ;
  1. ; First ask what kind of filter to use
  1. W !
  1. S DIR(0)="SA^1:Begins with;2:Contains;3:Range;4:Blank"
  1. S DIR("A")=" Select 1, 2, 3 or 4: "
  1. S DIR("A",1)="1 - Select Group(s) that Begin with: XXX"
  1. S DIR("A",2)="2 - Select Group(s) that Contain: XXX"
  1. S DIR("A",3)="3 - Select Group(s) in Range: XXX - YYY"
  1. S DIR("A",4)="4 - Select Group(s) that are BLANK"
  1. S DIR("?",1)="Select the type of filter to determine what Group(s) will be "
  1. S DIR("?",2)="displayed as follows:"
  1. S DIR("?",3)=" Begins with - Displays all group(s) that begin with the"
  1. S DIR("?",4)=" specified text (inclusive, case insensitive)"
  1. S DIR("?",5)=" Contains - Displays all group(s) that contain the"
  1. S DIR("?",6)=" specified text (inclusive, case insensitive)"
  1. S DIR("?",7)=" Range - Displays all group(s) within the "
  1. S DIR("?",8)=" specified range (inclusive, case insensitive)"
  1. S DIR("?")=" Blank - Displays all group(s) that are Blank or null"
  1. S XX="1:Begins with;2:Contains;3:Range;4:Blank"
  1. D ^DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q -1 ; No valid search selected
  1. S FILTER=Y
  1. I FILTER=4 G SELFILTQ
  1. ;
  1. ; Next ask for 'Begin with', 'Contains' or 'Range Start' text
  1. W !
  1. K DIR
  1. S DIR(0)="F^1;30"
  1. S XX=$S(FILTER=1:"that begin with",FILTER=2:"that contain",1:"Start of Range")
  1. S DIR("A")=" Select Group(s) "_XX
  1. I FILTER=1 D
  1. . S DIR("?")="Enter the text that each Group(s) will begin with"
  1. I FILTER=2 D
  1. . S DIR("?")="Enter the text that each Group(s) will contain"
  1. I FILTER=3 D
  1. . S DIR("?")="Enter the starting range text"
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q -1 ; No valid search selected
  1. S $P(FILTER,"^",2)=Y
  1. Q:$P(FILTER,"^",1)'=3 FILTER
  1. ;
  1. ; Finally, ask for 'Range End' text if using a range filter
  1. W !
  1. K DIR
  1. S DIR(0)="F^1;30"
  1. S DIR("A")=" Select Group(s) End of Range"
  1. S DIR("B")=$P(FILTER,"^",2)
  1. S DIR("?")="Enter the ending Range text"
  1. D ^DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q -1 ; No valid search selected
  1. S $P(FILTER,"^",3)=Y
  1. SELFILTQ ;
  1. Q FILTER
  1. ;
  1. ;
  1. SELCS ; Prompt user to select Coverage Status of the Group Plan(s)
  1. ; Input: None
  1. ; Returns: 1 - Coverage Status COVERED only
  1. ; 2 - Coverage Status NOT COVERED only
  1. ; 3 - Coverage Status CONDITIONAL only
  1. ; 4 - Coverage Status BY DEFAULT only
  1. ; 5 - ALL Coverage Statuses
  1. ; -1 - No selection made
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,XX
  1. W !
  1. S DIR(0)="SA^1:COVERED;2:NOT COVERED;3:CONDITIONAL;4:BY DEFAULT(blank status);5:ALL"
  1. S DIR("A")=" Select 1, 2, 3, 4 or 5: "
  1. S DIR("A",1)="1 - Select Coverage Status COVERED"
  1. S DIR("A",2)="2 - Select Coverage Status NOT COVERED"
  1. S DIR("A",3)="3 - Select Coverage Status CONDITIONAL"
  1. S DIR("A",4)="4 - Select Coverage Status BY DEFAULT (blank status)"
  1. S DIR("A",5)="5 - Show all Coverage Statuses"
  1. S DIR("?",1)="1 - Only allow selection of Coverage Status COVERED"
  1. S DIR("?",2)="2 - Only allow selection of Coverage Status NOT COVERED"
  1. S DIR("?",3)="3 - Only allow selection of Coverage Status CONDITIONAL"
  1. S DIR("?",4)="4 - Only allow selection of Coverage Status BY DEFAULT (blank status)"
  1. S DIR("?")="5 - Allow selection of All Coverage Statuses"
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELCSQ
  1. S IBCNGP("IBICS")=Y
  1. SELCSQ ;
  1. Q
  1. ;
  1. OUT ; Prompt to allow users to select output format
  1. ; Returns: E - Output to excel
  1. ; R - Output to report
  1. ; STOP=1 - No Selection made
  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. S DIR("?",1)="Select 'E' to create CSV output for import into Excel."
  1. S DIR("?")="Select 'R' to create a standard report."
  1. D ^DIR K DIR
  1. I $D(DIROUT)!$D(DIRUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G OUTQ
  1. S IBCNGP("IBOUT")=Y
  1. OUTQ ;
  1. Q