IBCOMDT ;ALB/CKB - INSURANCE COMPANY MISSING DATA REPORT (DRIVER/PROMPTS) ; 12-APR-2023
;;2.0;INTEGRATED BILLING;**763**;21-MAR-94;Build 29
;;Per VA Directive 6402, this routine should not be modified.
;
; ICR #1519-For using the KERNEL routine XUTMDEVQ
;
;
; IBCOMDT("IBI") 0-Selected, 1-ALL Insurance Companies
;
; IBCOMDT("IBSL1") 0 = ignore MAIN MAILING Street Line 1
; 1 = include MAIN MAILING Street Line 1
;
; IBCOMDT("IBSL2") 0 = ignore MAIN MAILING Street Line 2
; 1 = include MAIN MAILING Street Line 2
;
; IBCOMDT("IBSL3") 0 = ignore MAIN MAILING Street Line 3
; 1 = include MAIN MAILING Street Line 3
;
; IBCOMDT("IBCTY") 0 = ignore MAIN MAILING City
; 1 = include MAIN MAILING City
;
; IBCOMDT("IBST") 0 = ignore MAIN MAILING State
; 1 = include MAIN MAILING State
;
; IBCOMDT("IBZIP") 0 = ignore MAIN MAILING Zip+4
; 1 = include MAIN MAILING Zip+4
;
; IBCOMDT("IBCOV") 0 = ignore Type of Coverage
; 1 = include Type of Coverage
;
; IBCOMDT("IBFTF") 0 = ignore Missing Filing Time Frame filter
; 1 = include Missing Filing Time Frame filter
;
; IBCOMDT("IBOUT") E-EXCEL, R-REPORT
;
; IBCOMDT("$J") = $J of the parent job (if queued)
; IBCNRTN = "IBCOMDT" (routine name passed into the COMPILE process)
;
Q ; Must call EN
;
EN ; Main Entry point.
; Initialize variables.
N IBI,IBCOMDT,IBOUT,IBQUIT,POP,STOP,ZTDESC,ZTDEXC,ZTRTN,ZTSAVE,%ZIS
;
; Describe report
W @IOF
W !!,"INSURANCE COMPANY MISSING DATA REPORT"
W !!?5,"This report will generate a list of ACTIVE insurance companies"
W !?5,"that are missing the data that you select to be reported upon.",!
;
C0 ; Start of filters, allowing users to go back to first prompt
S IBCNRTN="IBCOMDT",IBCOMDT("$J")=$J
K ^TMP(IBCNRTN,IBCOMDT("$J"))
S (IBOUT,IBQUIT,STOP)=0
;
O10 ; Report or CSV output
D OUTPUT I STOP G EXIT
;
C10 ; User select ALL/Selected Insurance Companies
D SELINS I STOP G:$$STOP EXIT G O10
;
C20 ; If ALL Insurance Companies, add to ^TMP(IBCNRTN
I IBCOMDT("IBI") D
. N IBCNS,IBIC
. ; IBIC - Insurance Co Name / IBCNS - IEN of Insurance Co in file #36
. S IBIC=""
. F S IBIC=$O(^DIC(36,"B",IBIC)) Q:IBIC="" D
. .S IBCNS=0
. .F S IBCNS=$O(^DIC(36,"B",IBIC,IBCNS)) Q:'IBCNS D
. . . I $$GET1^DIQ(36,IBCNS_",",.05,"I") Q ; Only include Active Insurance Companies
. . . S ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
;
C30 ; If SELECTED Insurance Company(s), add to ^TMP(IBCNRTN
; Insurance Company look-up ListMan template to allow user selection
I 'IBCOMDT("IBI") D
. N IBCNS,IBIC
. D EN^IBCNILK(1) ; Only include Active Insurance Companies
. I '$D(^TMP("IBCNILKA",IBCOMDT("$J"))) Q ; No Insurance Companies selected
. S IBCNS="" F S IBCNS=$O(^TMP("IBCNILKA",IBCOMDT("$J"),IBCNS)) Q:IBCNS="" D
. . ; Insurance Company Name
. . S IBIC=$$GET1^DIQ(36,IBCNS_",",.01)
. . S ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
. K ^TMP("IBCNILKA",IBCOMDT("$J"))
;
; If No Insurance Company was selected.
I '$D(^TMP(IBCNRTN,IBCOMDT("$J"))) W !!,"No Insurance Companies selected!",!! D PAUSE^IBCOMDT1 G EXIT
;
; If user chose Excel output, skip filters. Excel reports on ALL fields.
I IBCOMDT("IBOUT")="E" G WARN
;
F0 ; Start of Filters
S IBCOMDT("SUBHD")=""
;
; Filter on Missing Street Line 1
F10 D SELSL1
I STOP G:$$STOP EXIT G C10
I +IBCOMDT("IBSL1") D
. S IBCOMDT("SUBHD")="ST LINE 1"
;
; Filter on Missing Street Line 2
F20 D SELSL2
I STOP G:$$STOP EXIT G F10
I +IBCOMDT("IBSL2") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 2"
;
; Filter on Missing Street Line 3
F30 D SELSL3
I STOP G:$$STOP EXIT G F20
I +IBCOMDT("IBSL3") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 3"
;
; Filter on Missing City
F40 D SELCTY
I STOP G:$$STOP EXIT G F30
I +IBCOMDT("IBCTY") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"CITY"
;
; Filter on Missing State
F50 D SELST
I STOP G:$$STOP EXIT G F40
I +IBCOMDT("IBST") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"STATE"
;
; Filter on Missing Zip+4
F60 D SELZIP
I STOP G:$$STOP EXIT G F50
I +IBCOMDT("IBZIP") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"ZIP+4"
;
; Filter on Missing Type of Coverage
F70 D SELCOV
I STOP G:$$STOP EXIT G F60
I +IBCOMDT("IBCOV") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"COVERAGE"
;
; Filter Filing Time Frame
F80 D SELFTF
I STOP G:$$STOP EXIT G F70
I +IBCOMDT("IBFTF") D
. S IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$S(IBCOMDT("SUBHD")'="":", ",1:"")_"FTF"
;
; If NO Filters were selected take the user back to the first filter question
I IBCOMDT("SUBHD")="" D G:$D(DUOUT)!(IBQUIT) EXIT G F0
. W !!,"** No Filters were selected **",!
. D PAUSE^IBCOMDT1
;
WARN ;
W !!,?14,"*** WARNING ***",!
W " This report may take a little while to compile!",!
;
D10 ; Select Device (ie., queue, print to screen...)
D DEVICE(IBCNRTN,.IBCOMDT)
I STOP G EXIT
;
EXIT ; Exit point
K ^TMP(IBCNRTN,IBCOMDT("$J"))
K ^TMP(IBCOMDT("$J"),"PR")
Q
;
;======================================Prompts==========================
SELINS ; Prompt user to select all or subset of insurance companies
; Count insurance companies with plans
; Returns: 0 - User selects insurance companies
; 1 - Run report for all insurance companies with plans
; STOP=1 - No selection made
;
N A,B
S (A,B)=0
F S A=$O(^IBA(355.3,"B",A)) Q:'A S B=B+1
;
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
W !
S DIR(0)="SA^1:List All "_B_" Ins. Companies;2:List Only Ins. Companies That You Select"
S DIR("A",1)=" 1 - List All "_B_" Ins. Companies"
S DIR("A",2)=" 2 - List Only Ins. Companies That You Select"
S DIR("A")=" SELECT 1 or 2: "
S DIR("?",1)="Enter a code from the list: 1 or 2. Only insurance"
S DIR("?")="companies with one or more plans can be selected."
D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELINSQ
S IBCOMDT("IBI")=(+Y=1) K Y
SELINSQ ;
Q
;
OUTPUT ; Prompt to allow users to select output format
; Returns: E - Output to excel
; R - Output to report
; STOP=1 - No Selection made
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
W !
S DIR(0)="SA^E:Excel;R:Report"
S DIR("A")="(E)xcel Format or (R)eport Format: "
S DIR("B")="Report"
S DIR("?",1)="Select 'E' to create CSV output for import into Excel."
S DIR("?")="Select 'R' to create a standard report."
D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G OUTQ
S IBCOMDT("IBOUT")=Y
OUTQ ;
Q
DEVICE(IBCNRTN,IBCOMDT) ; Device Handler and possible TaskManager calls
; Input params:
; IBCNRTN = Routine name for ^TMP(IBCNRTN,IBCOMDT("$J"),...
; IBCOMDT = Array passed by ref of the report params
; Output params:
; STOP = Flag to stop routine, exit option
;
; Init vars
I IBCOMDT("IBOUT")="E" D
. W !!,"For CSV output, turn logging or capture on now. To avoid undesired wrapping"
. W !,"of the data saved to the file, please enter ""0;256;99999"" at the ""DEVICE:"""
. W !,"prompt.",!
;
; IBCNGP = Array of Params
N POP,ZTDESC,ZTRTN,ZTSAVE
S ZTRTN="COMPILE^IBCOMDT1(IBCNRTN,.IBCOMDT)"
S ZTDESC="INSURANCE COMPANY MISSING DATA REPORT"
S ZTSAVE("^TMP(IBCNRTN,IBCOMDT(""$J""),")=""
S ZTSAVE("IBCOMDT(")=""
S ZTSAVE("IBCNRTN")=""
D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"Q") ; ICR # 1519
I POP S STOP=1
;
DEVICEX ; DEVICE exit pt
Q
;
STOP() ; Determine if user wants to exit out of the whole option
; Initialize Variables
N DIR,DIRUT,X,Y
W !
S DIR(0)="Y"
S DIR("A")="Do you want to exit out of this option entirely"
S DIR("B")="YES"
S DIR("?",1)=" Enter YES to immediately exit out of this option."
S DIR("?")=" Enter NO to return to the previous question."
D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S (STOP,Y)=1 G STOPX
I 'Y S STOP=0
STOPX ; STOP Exit Point
Q Y
;
;===============================Filter Prompts==========================
SELSL1 ; Prompt user to report missing Street Line 1
;
; 0 -- Do not print missing Street Line 1
; 1 -- Print missing Street Line 1
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 1"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'STREET LINE 1' when missing."
S DIR("?")="Answering No ignores missing Street Line 1."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL1Q
S IBCOMDT("IBSL1")=+Y K Y
SELSL1Q ;
Q
;
SELSL2 ; Prompt user to report missing Street Line 2
;
; 0 -- Do not print missing Street Line 2
; 1 -- Print missing Street Line 2
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 2"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'STREET LINE 2' when missing."
S DIR("?")="Answering No ignores missing Street Line 2."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL2Q
S IBCOMDT("IBSL2")=+Y K Y
SELSL2Q ;
Q
;
SELSL3 ; Prompt user to report missing Street Line 3
;
; 0 -- Do not print missing Street Line 3
; 1 -- Print missing Street Line 3
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 3"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'STREET LINE 3' when missing."
S DIR("?")="Answering No ignores missing Street Line 3."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSL3Q
S IBCOMDT("IBSL3")=+Y K Y
SELSL3Q ;
Q
;
SELCTY ; Prompt user to report missing City
;
; 0 -- Do not print missing City
; 1 -- Print missing City
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING CITY"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'CITY' when missing."
S DIR("?")="Answering No ignores missing City."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELCTYQ
S IBCOMDT("IBCTY")=+Y K Y
SELCTYQ ;
Q
;
SELST ; Prompt user to report missing State
;
; 0 -- Do not print missing State
; 1 -- Print missing State
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING STATE"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'STATE' when missing."
S DIR("?")="Answering No ignores missing State."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELSTQ
S IBCOMDT("IBST")=+Y K Y
SELSTQ ;
Q
;
SELZIP ; Prompt user to report missing Zip+4
;
; 0 -- Do not print missing Zip+4
; 1 -- Print missing Zip+4
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing MAIN MAILING ZIP+4"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'ZIP+4' when missing."
S DIR("?")="Answering No ignores missing Zip+4."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELZIPQ
S IBCOMDT("IBZIP")=+Y K Y
SELZIPQ ;
Q
;
SELCOV ; Prompt user to report missing Type of Coverage
;
; 0 -- Do not print missing Type of Coverage
; 1 -- Print missing Type of Coverage
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing TYPE OF COVERAGE"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'TYPE OF COVERAGE' when missing."
S DIR("?")="Answering No ignores missing Type of Coverage."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELCOVQ
S IBCOMDT("IBCOV")=+Y K Y
SELCOVQ ;
Q
;
SELFTF ; Prompt user to report missing Filing Time Frame
;
; 0 -- Do not print missing Filing Time Frame
; 1 -- Print missing Filing Time Frame
;
S DIR(0)="YO"
S DIR("A")="Display Ins Co with a missing FILING TIME FRAME"
S DIR("B")="YES"
S DIR("?",1)="Answering Yes displays the text 'FILING TIME FRAME' when missing."
S DIR("?")="Answering No ignores missing Filing Time Frame."
W ! D ^DIR K DIR
I $D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT) S STOP=1 G SELFTFQ
S IBCOMDT("IBFTF")=+Y K Y
SELFTFQ ;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCOMDT 12402 printed Oct 16, 2024@18:19:02 Page 2
IBCOMDT ;ALB/CKB - INSURANCE COMPANY MISSING DATA REPORT (DRIVER/PROMPTS) ; 12-APR-2023
+1 ;;2.0;INTEGRATED BILLING;**763**;21-MAR-94;Build 29
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; ICR #1519-For using the KERNEL routine XUTMDEVQ
+5 ;
+6 ;
+7 ; IBCOMDT("IBI") 0-Selected, 1-ALL Insurance Companies
+8 ;
+9 ; IBCOMDT("IBSL1") 0 = ignore MAIN MAILING Street Line 1
+10 ; 1 = include MAIN MAILING Street Line 1
+11 ;
+12 ; IBCOMDT("IBSL2") 0 = ignore MAIN MAILING Street Line 2
+13 ; 1 = include MAIN MAILING Street Line 2
+14 ;
+15 ; IBCOMDT("IBSL3") 0 = ignore MAIN MAILING Street Line 3
+16 ; 1 = include MAIN MAILING Street Line 3
+17 ;
+18 ; IBCOMDT("IBCTY") 0 = ignore MAIN MAILING City
+19 ; 1 = include MAIN MAILING City
+20 ;
+21 ; IBCOMDT("IBST") 0 = ignore MAIN MAILING State
+22 ; 1 = include MAIN MAILING State
+23 ;
+24 ; IBCOMDT("IBZIP") 0 = ignore MAIN MAILING Zip+4
+25 ; 1 = include MAIN MAILING Zip+4
+26 ;
+27 ; IBCOMDT("IBCOV") 0 = ignore Type of Coverage
+28 ; 1 = include Type of Coverage
+29 ;
+30 ; IBCOMDT("IBFTF") 0 = ignore Missing Filing Time Frame filter
+31 ; 1 = include Missing Filing Time Frame filter
+32 ;
+33 ; IBCOMDT("IBOUT") E-EXCEL, R-REPORT
+34 ;
+35 ; IBCOMDT("$J") = $J of the parent job (if queued)
+36 ; IBCNRTN = "IBCOMDT" (routine name passed into the COMPILE process)
+37 ;
+38 ; Must call EN
QUIT
+39 ;
EN ; Main Entry point.
+1 ; Initialize variables.
+2 NEW IBI,IBCOMDT,IBOUT,IBQUIT,POP,STOP,ZTDESC,ZTDEXC,ZTRTN,ZTSAVE,%ZIS
+3 ;
+4 ; Describe report
+5 WRITE @IOF
+6 WRITE !!,"INSURANCE COMPANY MISSING DATA REPORT"
+7 WRITE !!?5,"This report will generate a list of ACTIVE insurance companies"
+8 WRITE !?5,"that are missing the data that you select to be reported upon.",!
+9 ;
C0 ; Start of filters, allowing users to go back to first prompt
+1 SET IBCNRTN="IBCOMDT"
SET IBCOMDT("$J")=$JOB
+2 KILL ^TMP(IBCNRTN,IBCOMDT("$J"))
+3 SET (IBOUT,IBQUIT,STOP)=0
+4 ;
O10 ; Report or CSV output
+1 DO OUTPUT
IF STOP
GOTO EXIT
+2 ;
C10 ; User select ALL/Selected Insurance Companies
+1 DO SELINS
IF STOP
if $$STOP
GOTO EXIT
GOTO O10
+2 ;
C20 ; If ALL Insurance Companies, add to ^TMP(IBCNRTN
+1 IF IBCOMDT("IBI")
Begin DoDot:1
+2 NEW IBCNS,IBIC
+3 ; IBIC - Insurance Co Name / IBCNS - IEN of Insurance Co in file #36
+4 SET IBIC=""
+5 FOR
SET IBIC=$ORDER(^DIC(36,"B",IBIC))
if IBIC=""
QUIT
Begin DoDot:2
+6 SET IBCNS=0
+7 FOR
SET IBCNS=$ORDER(^DIC(36,"B",IBIC,IBCNS))
if 'IBCNS
QUIT
Begin DoDot:3
+8 ; Only include Active Insurance Companies
IF $$GET1^DIQ(36,IBCNS_",",.05,"I")
QUIT
+9 SET ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
End DoDot:3
End DoDot:2
End DoDot:1
+10 ;
C30 ; If SELECTED Insurance Company(s), add to ^TMP(IBCNRTN
+1 ; Insurance Company look-up ListMan template to allow user selection
+2 IF 'IBCOMDT("IBI")
Begin DoDot:1
+3 NEW IBCNS,IBIC
+4 ; Only include Active Insurance Companies
DO EN^IBCNILK(1)
+5 ; No Insurance Companies selected
IF '$DATA(^TMP("IBCNILKA",IBCOMDT("$J")))
QUIT
+6 SET IBCNS=""
FOR
SET IBCNS=$ORDER(^TMP("IBCNILKA",IBCOMDT("$J"),IBCNS))
if IBCNS=""
QUIT
Begin DoDot:2
+7 ; Insurance Company Name
+8 SET IBIC=$$GET1^DIQ(36,IBCNS_",",.01)
+9 SET ^TMP(IBCNRTN,IBCOMDT("$J"),IBIC,IBCNS)=""
End DoDot:2
+10 KILL ^TMP("IBCNILKA",IBCOMDT("$J"))
End DoDot:1
+11 ;
+12 ; If No Insurance Company was selected.
+13 IF '$DATA(^TMP(IBCNRTN,IBCOMDT("$J")))
WRITE !!,"No Insurance Companies selected!",!!
DO PAUSE^IBCOMDT1
GOTO EXIT
+14 ;
+15 ; If user chose Excel output, skip filters. Excel reports on ALL fields.
+16 IF IBCOMDT("IBOUT")="E"
GOTO WARN
+17 ;
F0 ; Start of Filters
+1 SET IBCOMDT("SUBHD")=""
+2 ;
+3 ; Filter on Missing Street Line 1
F10 DO SELSL1
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO C10
+2 IF +IBCOMDT("IBSL1")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")="ST LINE 1"
End DoDot:1
+4 ;
+5 ; Filter on Missing Street Line 2
F20 DO SELSL2
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F10
+2 IF +IBCOMDT("IBSL2")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 2"
End DoDot:1
+4 ;
+5 ; Filter on Missing Street Line 3
F30 DO SELSL3
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F20
+2 IF +IBCOMDT("IBSL3")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"ST LINE 3"
End DoDot:1
+4 ;
+5 ; Filter on Missing City
F40 DO SELCTY
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F30
+2 IF +IBCOMDT("IBCTY")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"CITY"
End DoDot:1
+4 ;
+5 ; Filter on Missing State
F50 DO SELST
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F40
+2 IF +IBCOMDT("IBST")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"STATE"
End DoDot:1
+4 ;
+5 ; Filter on Missing Zip+4
F60 DO SELZIP
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F50
+2 IF +IBCOMDT("IBZIP")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"ZIP+4"
End DoDot:1
+4 ;
+5 ; Filter on Missing Type of Coverage
F70 DO SELCOV
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F60
+2 IF +IBCOMDT("IBCOV")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"COVERAGE"
End DoDot:1
+4 ;
+5 ; Filter Filing Time Frame
F80 DO SELFTF
+1 IF STOP
if $$STOP
GOTO EXIT
GOTO F70
+2 IF +IBCOMDT("IBFTF")
Begin DoDot:1
+3 SET IBCOMDT("SUBHD")=IBCOMDT("SUBHD")_$SELECT(IBCOMDT("SUBHD")'="":", ",1:"")_"FTF"
End DoDot:1
+4 ;
+5 ; If NO Filters were selected take the user back to the first filter question
+6 IF IBCOMDT("SUBHD")=""
Begin DoDot:1
+7 WRITE !!,"** No Filters were selected **",!
+8 DO PAUSE^IBCOMDT1
End DoDot:1
if $DATA(DUOUT)!(IBQUIT)
GOTO EXIT
GOTO F0
+9 ;
WARN ;
+1 WRITE !!,?14,"*** WARNING ***",!
+2 WRITE " This report may take a little while to compile!",!
+3 ;
D10 ; Select Device (ie., queue, print to screen...)
+1 DO DEVICE(IBCNRTN,.IBCOMDT)
+2 IF STOP
GOTO EXIT
+3 ;
EXIT ; Exit point
+1 KILL ^TMP(IBCNRTN,IBCOMDT("$J"))
+2 KILL ^TMP(IBCOMDT("$J"),"PR")
+3 QUIT
+4 ;
+5 ;======================================Prompts==========================
SELINS ; Prompt user to select all or subset of insurance companies
+1 ; Count insurance companies with plans
+2 ; Returns: 0 - User selects insurance companies
+3 ; 1 - Run report for all insurance companies with plans
+4 ; STOP=1 - No selection made
+5 ;
+6 NEW A,B
+7 SET (A,B)=0
+8 FOR
SET A=$ORDER(^IBA(355.3,"B",A))
if 'A
QUIT
SET B=B+1
+9 ;
+10 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+11 WRITE !
+12 SET DIR(0)="SA^1:List All "_B_" Ins. Companies;2:List Only Ins. Companies That You Select"
+13 SET DIR("A",1)=" 1 - List All "_B_" Ins. Companies"
+14 SET DIR("A",2)=" 2 - List Only Ins. Companies That You Select"
+15 SET DIR("A")=" SELECT 1 or 2: "
+16 SET DIR("?",1)="Enter a code from the list: 1 or 2. Only insurance"
+17 SET DIR("?")="companies with one or more plans can be selected."
+18 DO ^DIR
KILL DIR
+19 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELINSQ
+20 SET IBCOMDT("IBI")=(+Y=1)
KILL Y
SELINSQ ;
+1 QUIT
+2 ;
OUTPUT ; Prompt to allow users to select output format
+1 ; Returns: E - Output to excel
+2 ; R - Output to report
+3 ; STOP=1 - No Selection made
+4 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+5 WRITE !
+6 SET DIR(0)="SA^E:Excel;R:Report"
+7 SET DIR("A")="(E)xcel Format or (R)eport Format: "
+8 SET DIR("B")="Report"
+9 SET DIR("?",1)="Select 'E' to create CSV output for import into Excel."
+10 SET DIR("?")="Select 'R' to create a standard report."
+11 DO ^DIR
KILL DIR
+12 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO OUTQ
+13 SET IBCOMDT("IBOUT")=Y
OUTQ ;
+1 QUIT
DEVICE(IBCNRTN,IBCOMDT) ; Device Handler and possible TaskManager calls
+1 ; Input params:
+2 ; IBCNRTN = Routine name for ^TMP(IBCNRTN,IBCOMDT("$J"),...
+3 ; IBCOMDT = Array passed by ref of the report params
+4 ; Output params:
+5 ; STOP = Flag to stop routine, exit option
+6 ;
+7 ; Init vars
+8 IF IBCOMDT("IBOUT")="E"
Begin DoDot:1
+9 WRITE !!,"For CSV output, turn logging or capture on now. To avoid undesired wrapping"
+10 WRITE !,"of the data saved to the file, please enter ""0;256;99999"" at the ""DEVICE:"""
+11 WRITE !,"prompt.",!
End DoDot:1
+12 ;
+13 ; IBCNGP = Array of Params
+14 NEW POP,ZTDESC,ZTRTN,ZTSAVE
+15 SET ZTRTN="COMPILE^IBCOMDT1(IBCNRTN,.IBCOMDT)"
+16 SET ZTDESC="INSURANCE COMPANY MISSING DATA REPORT"
+17 SET ZTSAVE("^TMP(IBCNRTN,IBCOMDT(""$J""),")=""
+18 SET ZTSAVE("IBCOMDT(")=""
+19 SET ZTSAVE("IBCNRTN")=""
+20 ; ICR # 1519
DO EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"Q")
+21 IF POP
SET STOP=1
+22 ;
DEVICEX ; DEVICE exit pt
+1 QUIT
+2 ;
STOP() ; Determine if user wants to exit out of the whole option
+1 ; Initialize Variables
+2 NEW DIR,DIRUT,X,Y
+3 WRITE !
+4 SET DIR(0)="Y"
+5 SET DIR("A")="Do you want to exit out of this option entirely"
+6 SET DIR("B")="YES"
+7 SET DIR("?",1)=" Enter YES to immediately exit out of this option."
+8 SET DIR("?")=" Enter NO to return to the previous question."
+9 DO ^DIR
KILL DIR
+10 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET (STOP,Y)=1
GOTO STOPX
+11 IF 'Y
SET STOP=0
STOPX ; STOP Exit Point
+1 QUIT Y
+2 ;
+3 ;===============================Filter Prompts==========================
SELSL1 ; Prompt user to report missing Street Line 1
+1 ;
+2 ; 0 -- Do not print missing Street Line 1
+3 ; 1 -- Print missing Street Line 1
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 1"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'STREET LINE 1' when missing."
+9 SET DIR("?")="Answering No ignores missing Street Line 1."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELSL1Q
+12 SET IBCOMDT("IBSL1")=+Y
KILL Y
SELSL1Q ;
+1 QUIT
+2 ;
SELSL2 ; Prompt user to report missing Street Line 2
+1 ;
+2 ; 0 -- Do not print missing Street Line 2
+3 ; 1 -- Print missing Street Line 2
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 2"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'STREET LINE 2' when missing."
+9 SET DIR("?")="Answering No ignores missing Street Line 2."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELSL2Q
+12 SET IBCOMDT("IBSL2")=+Y
KILL Y
SELSL2Q ;
+1 QUIT
+2 ;
SELSL3 ; Prompt user to report missing Street Line 3
+1 ;
+2 ; 0 -- Do not print missing Street Line 3
+3 ; 1 -- Print missing Street Line 3
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING STREET LINE 3"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'STREET LINE 3' when missing."
+9 SET DIR("?")="Answering No ignores missing Street Line 3."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELSL3Q
+12 SET IBCOMDT("IBSL3")=+Y
KILL Y
SELSL3Q ;
+1 QUIT
+2 ;
SELCTY ; Prompt user to report missing City
+1 ;
+2 ; 0 -- Do not print missing City
+3 ; 1 -- Print missing City
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING CITY"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'CITY' when missing."
+9 SET DIR("?")="Answering No ignores missing City."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELCTYQ
+12 SET IBCOMDT("IBCTY")=+Y
KILL Y
SELCTYQ ;
+1 QUIT
+2 ;
SELST ; Prompt user to report missing State
+1 ;
+2 ; 0 -- Do not print missing State
+3 ; 1 -- Print missing State
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING STATE"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'STATE' when missing."
+9 SET DIR("?")="Answering No ignores missing State."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELSTQ
+12 SET IBCOMDT("IBST")=+Y
KILL Y
SELSTQ ;
+1 QUIT
+2 ;
SELZIP ; Prompt user to report missing Zip+4
+1 ;
+2 ; 0 -- Do not print missing Zip+4
+3 ; 1 -- Print missing Zip+4
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing MAIN MAILING ZIP+4"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'ZIP+4' when missing."
+9 SET DIR("?")="Answering No ignores missing Zip+4."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELZIPQ
+12 SET IBCOMDT("IBZIP")=+Y
KILL Y
SELZIPQ ;
+1 QUIT
+2 ;
SELCOV ; Prompt user to report missing Type of Coverage
+1 ;
+2 ; 0 -- Do not print missing Type of Coverage
+3 ; 1 -- Print missing Type of Coverage
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing TYPE OF COVERAGE"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'TYPE OF COVERAGE' when missing."
+9 SET DIR("?")="Answering No ignores missing Type of Coverage."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELCOVQ
+12 SET IBCOMDT("IBCOV")=+Y
KILL Y
SELCOVQ ;
+1 QUIT
+2 ;
SELFTF ; Prompt user to report missing Filing Time Frame
+1 ;
+2 ; 0 -- Do not print missing Filing Time Frame
+3 ; 1 -- Print missing Filing Time Frame
+4 ;
+5 SET DIR(0)="YO"
+6 SET DIR("A")="Display Ins Co with a missing FILING TIME FRAME"
+7 SET DIR("B")="YES"
+8 SET DIR("?",1)="Answering Yes displays the text 'FILING TIME FRAME' when missing."
+9 SET DIR("?")="Answering No ignores missing Filing Time Frame."
+10 WRITE !
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
SET STOP=1
GOTO SELFTFQ
+12 SET IBCOMDT("IBFTF")=+Y
KILL Y
SELFTFQ ;
+1 QUIT