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

IBCOMDT.m

Go to the documentation of this file.
  1. IBCOMDT ;ALB/CKB - INSURANCE COMPANY MISSING DATA REPORT (DRIVER/PROMPTS) ; 12-APR-2023
  1. ;;2.0;INTEGRATED BILLING;**763**;21-MAR-94;Build 29
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; ICR #1519-For using the KERNEL routine XUTMDEVQ
  1. ;
  1. ;
  1. ; IBCOMDT("IBI") 0-Selected, 1-ALL Insurance Companies
  1. ;
  1. ; IBCOMDT("IBSL1") 0 = ignore MAIN MAILING Street Line 1
  1. ; 1 = include MAIN MAILING Street Line 1
  1. ;
  1. ; IBCOMDT("IBSL2") 0 = ignore MAIN MAILING Street Line 2
  1. ; 1 = include MAIN MAILING Street Line 2
  1. ;
  1. ; IBCOMDT("IBSL3") 0 = ignore MAIN MAILING Street Line 3
  1. ; 1 = include MAIN MAILING Street Line 3
  1. ;
  1. ; IBCOMDT("IBCTY") 0 = ignore MAIN MAILING City
  1. ; 1 = include MAIN MAILING City
  1. ;
  1. ; IBCOMDT("IBST") 0 = ignore MAIN MAILING State
  1. ; 1 = include MAIN MAILING State
  1. ;
  1. ; IBCOMDT("IBZIP") 0 = ignore MAIN MAILING Zip+4
  1. ; 1 = include MAIN MAILING Zip+4
  1. ;
  1. ; IBCOMDT("IBCOV") 0 = ignore Type of Coverage
  1. ; 1 = include Type of Coverage
  1. ;
  1. ; IBCOMDT("IBFTF") 0 = ignore Missing Filing Time Frame filter
  1. ; 1 = include Missing Filing Time Frame filter
  1. ;
  1. ; IBCOMDT("IBOUT") E-EXCEL, R-REPORT
  1. ;
  1. ; IBCOMDT("$J") = $J of the parent job (if queued)
  1. ; IBCNRTN = "IBCOMDT" (routine name passed into the COMPILE process)
  1. ;
  1. Q ; Must call EN
  1. ;
  1. EN ; Main Entry point.
  1. ; Initialize variables.
  1. N IBI,IBCOMDT,IBOUT,IBQUIT,POP,STOP,ZTDESC,ZTDEXC,ZTRTN,ZTSAVE,%ZIS
  1. ;
  1. ; Describe report
  1. W @IOF
  1. W !!,"INSURANCE COMPANY MISSING DATA REPORT"
  1. W !!?5,"This report will generate a list of ACTIVE insurance companies"
  1. W !?5,"that are missing the data that you select to be reported upon.",!
  1. ;
  1. C0 ; Start of filters, allowing users to go back to first prompt
  1. S IBCNRTN="IBCOMDT",IBCOMDT("$J")=$J
  1. K ^TMP(IBCNRTN,IBCOMDT("$J"))
  1. S (IBOUT,IBQUIT,STOP)=0
  1. ;
  1. O10 ; Report or CSV output
  1. D OUTPUT I STOP G EXIT
  1. ;
  1. C10 ; User select ALL/Selected Insurance Companies
  1. D SELINS I STOP G:$$STOP EXIT G O10
  1. ;
  1. C20 ; If ALL Insurance Companies, add to ^TMP(IBCNRTN
  1. I IBCOMDT("IBI") D
  1. . N IBCNS,IBIC
  1. . ; IBIC - Insurance Co Name / IBCNS - IEN of Insurance Co in file #36
  1. . S IBIC=""
  1. . F S IBIC=$O(^DIC(36,"B",IBIC)) Q:IBIC="" D
  1. . .S IBCNS=0
  1. . .F S IBCNS=$O(^DIC(36,"B",IBIC,IBCNS)) Q:'IBCNS D
  1. . . . I $$GET1^DIQ(36,IBCNS_",",.05,"I") Q ; Only include Active Insurance Companies
  1. . . . S ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
  1. ;
  1. C30 ; If SELECTED Insurance Company(s), add to ^TMP(IBCNRTN
  1. ; Insurance Company look-up ListMan template to allow user selection
  1. I 'IBCOMDT("IBI") D
  1. . N IBCNS,IBIC
  1. . D EN^IBCNILK(1) ; Only include Active Insurance Companies
  1. . I '$D(^TMP("IBCNILKA",IBCOMDT("$J"))) Q ; No Insurance Companies selected
  1. . S IBCNS="" F S IBCNS=$O(^TMP("IBCNILKA",IBCOMDT("$J"),IBCNS)) Q:IBCNS="" D
  1. . . ; Insurance Company Name
  1. . . S IBIC=$$GET1^DIQ(36,IBCNS_",",.01)
  1. . . S ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
  1. . K ^TMP("IBCNILKA",IBCOMDT("$J"))
  1. ;
  1. ; If No Insurance Company was selected.
  1. I '$D(^TMP(IBCNRTN,IBCOMDT("$J"))) W !!,"No Insurance Companies selected!",!! D PAUSE^IBCOMDT1 G EXIT
  1. ;
  1. ; If user chose Excel output, skip filters. Excel reports on ALL fields.
  1. I IBCOMDT("IBOUT")="E" G WARN
  1. ;
  1. F0 ; Start of Filters
  1. S IBCOMDT("SUBHD")=""
  1. ;
  1. ; Filter on Missing Street Line 1
  1. F10 D SELSL1
  1. I STOP G:$$STOP EXIT G C10
  1. I +IBCOMDT("IBSL1") D
  1. . S IBCOMDT("SUBHD")="ST LINE 1"
  1. ;
  1. ; Filter on Missing Street Line 2
  1. F20 D SELSL2
  1. I STOP G:$$STOP EXIT G F10
  1. I +IBCOMDT("IBSL2") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 2"
  1. ;
  1. ; Filter on Missing Street Line 3
  1. F30 D SELSL3
  1. I STOP G:$$STOP EXIT G F20
  1. I +IBCOMDT("IBSL3") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 3"
  1. ;
  1. ; Filter on Missing City
  1. F40 D SELCTY
  1. I STOP G:$$STOP EXIT G F30
  1. I +IBCOMDT("IBCTY") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"CITY"
  1. ;
  1. ; Filter on Missing State
  1. F50 D SELST
  1. I STOP G:$$STOP EXIT G F40
  1. I +IBCOMDT("IBST") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"STATE"
  1. ;
  1. ; Filter on Missing Zip+4
  1. F60 D SELZIP
  1. I STOP G:$$STOP EXIT G F50
  1. I +IBCOMDT("IBZIP") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ZIP+4"
  1. ;
  1. ; Filter on Missing Type of Coverage
  1. F70 D SELCOV
  1. I STOP G:$$STOP EXIT G F60
  1. I +IBCOMDT("IBCOV") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"COVERAGE"
  1. ;
  1. ; Filter Filing Time Frame
  1. F80 D SELFTF
  1. I STOP G:$$STOP EXIT G F70
  1. I +IBCOMDT("IBFTF") D
  1. . S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"FTF"
  1. ;
  1. ; If NO Filters were selected take the user back to the first filter question
  1. I IBCOMDT("SUBHD")="" D G:$D(DUOUT)!(IBQUIT) EXIT G F0
  1. . W !!,"** No Filters were selected **",!
  1. . D PAUSE^IBCOMDT1
  1. ;
  1. WARN ;
  1. W !!,?14,"*** WARNING ***",!
  1. W " This report may take a little while to compile!",!
  1. ;
  1. D10 ; Select Device (ie., queue, print to screen...)
  1. D DEVICE(IBCNRTN,.IBCOMDT)
  1. I STOP G EXIT
  1. ;
  1. EXIT ; Exit point
  1. K ^TMP(IBCNRTN,IBCOMDT("$J"))
  1. K ^TMP(IBCOMDT("$J"),"PR")
  1. Q
  1. ;
  1. ;======================================Prompts==========================
  1. SELINS ; 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(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELINSQ
  1. S IBCOMDT("IBI")=(+Y=1) K Y
  1. SELINSQ ;
  1. Q
  1. ;
  1. OUTPUT ; 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(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G OUTQ
  1. S IBCOMDT("IBOUT")=Y
  1. OUTQ ;
  1. Q
  1. DEVICE(IBCNRTN,IBCOMDT) ; Device Handler and possible TaskManager calls
  1. ; Input params:
  1. ; IBCNRTN = Routine name for ^TMP(IBCNRTN,IBCOMDT("$J"),...
  1. ; IBCOMDT = Array passed by ref of the report params
  1. ; Output params:
  1. ; STOP = Flag to stop routine, exit option
  1. ;
  1. ; Init vars
  1. I IBCOMDT("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. ;
  1. ; IBCNGP = Array of Params
  1. N POP,ZTDESC,ZTRTN,ZTSAVE
  1. S ZTRTN="COMPILE^IBCOMDT1(IBCNRTN,.IBCOMDT)"
  1. S ZTDESC="INSURANCE COMPANY MISSING DATA REPORT"
  1. S ZTSAVE("^TMP(IBCNRTN,IBCOMDT(""$J""),")=""
  1. S ZTSAVE("IBCOMDT(")=""
  1. S ZTSAVE("IBCNRTN")=""
  1. D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"Q") ; ICR # 1519
  1. I POP S STOP=1
  1. ;
  1. DEVICEX ; DEVICE exit pt
  1. Q
  1. ;
  1. STOP() ; Determine if user wants to exit out of the whole option
  1. ; Initialize Variables
  1. N DIR,DIRUT,X,Y
  1. W !
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to exit out of this option entirely"
  1. S DIR("B")="YES"
  1. S DIR("?",1)=" Enter YES to immediately exit out of this option."
  1. S DIR("?")=" Enter NO to return to the previous question."
  1. D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S (STOP,Y)=1 G STOPX
  1. I 'Y S STOP=0
  1. STOPX ; STOP Exit Point
  1. Q Y
  1. ;
  1. ;===============================Filter Prompts==========================
  1. SELSL1 ; Prompt user to report missing Street Line 1
  1. ;
  1. ; 0 -- Do not print missing Street Line 1
  1. ; 1 -- Print missing Street Line 1
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 1"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'STREET LINE 1' when missing."
  1. S DIR("?")="Answering No ignores missing Street Line 1."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL1Q
  1. S IBCOMDT("IBSL1")=+Y K Y
  1. SELSL1Q ;
  1. Q
  1. ;
  1. SELSL2 ; Prompt user to report missing Street Line 2
  1. ;
  1. ; 0 -- Do not print missing Street Line 2
  1. ; 1 -- Print missing Street Line 2
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 2"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'STREET LINE 2' when missing."
  1. S DIR("?")="Answering No ignores missing Street Line 2."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL2Q
  1. S IBCOMDT("IBSL2")=+Y K Y
  1. SELSL2Q ;
  1. Q
  1. ;
  1. SELSL3 ; Prompt user to report missing Street Line 3
  1. ;
  1. ; 0 -- Do not print missing Street Line 3
  1. ; 1 -- Print missing Street Line 3
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 3"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'STREET LINE 3' when missing."
  1. S DIR("?")="Answering No ignores missing Street Line 3."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL3Q
  1. S IBCOMDT("IBSL3")=+Y K Y
  1. SELSL3Q ;
  1. Q
  1. ;
  1. SELCTY ; Prompt user to report missing City
  1. ;
  1. ; 0 -- Do not print missing City
  1. ; 1 -- Print missing City
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING CITY"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'CITY' when missing."
  1. S DIR("?")="Answering No ignores missing City."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELCTYQ
  1. S IBCOMDT("IBCTY")=+Y K Y
  1. SELCTYQ ;
  1. Q
  1. ;
  1. SELST ; Prompt user to report missing State
  1. ;
  1. ; 0 -- Do not print missing State
  1. ; 1 -- Print missing State
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING STATE"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'STATE' when missing."
  1. S DIR("?")="Answering No ignores missing State."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSTQ
  1. S IBCOMDT("IBST")=+Y K Y
  1. SELSTQ ;
  1. Q
  1. ;
  1. SELZIP ; Prompt user to report missing Zip+4
  1. ;
  1. ; 0 -- Do not print missing Zip+4
  1. ; 1 -- Print missing Zip+4
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing MAIN MAILING ZIP+4"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'ZIP+4' when missing."
  1. S DIR("?")="Answering No ignores missing Zip+4."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELZIPQ
  1. S IBCOMDT("IBZIP")=+Y K Y
  1. SELZIPQ ;
  1. Q
  1. ;
  1. SELCOV ; Prompt user to report missing Type of Coverage
  1. ;
  1. ; 0 -- Do not print missing Type of Coverage
  1. ; 1 -- Print missing Type of Coverage
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing TYPE OF COVERAGE"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'TYPE OF COVERAGE' when missing."
  1. S DIR("?")="Answering No ignores missing Type of Coverage."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELCOVQ
  1. S IBCOMDT("IBCOV")=+Y K Y
  1. SELCOVQ ;
  1. Q
  1. ;
  1. SELFTF ; Prompt user to report missing Filing Time Frame
  1. ;
  1. ; 0 -- Do not print missing Filing Time Frame
  1. ; 1 -- Print missing Filing Time Frame
  1. ;
  1. S DIR(0)="YO"
  1. S DIR("A")="Display Ins Co with a missing FILING TIME FRAME"
  1. S DIR("B")="YES"
  1. S DIR("?",1)="Answering Yes displays the text 'FILING TIME FRAME' when missing."
  1. S DIR("?")="Answering No ignores missing Filing Time Frame."
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELFTFQ
  1. S IBCOMDT("IBFTF")=+Y K Y
  1. SELFTFQ ;
  1. Q