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

IBCNERPD.m

Go to the documentation of this file.
  1. IBCNERPD ;DAOU/RO - INSURANCE COMPANY LINK REPORT ;AUG-2003
  1. ;;2.0;INTEGRATED BILLING;**184,252,416,521,528,595,602,687,752**;21-MAR-94;Build 20
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; eIV - Insurance Verification Interface
  1. ;
  1. ; IB*2.0*687 - split this report out from another report(rewriting it). We reused
  1. ; this routine that the old report no longer needs. Therefore, any changes based
  1. ; on the patches prior to IB*2.0*687 will no longer apply to this code. You will
  1. ; not find any references to them below.
  1. ;
  1. ; Input parameters: N/A
  1. ; Other relevant variables ZTSAVED for queueing:
  1. ; IBCNERTN="IBCNERPD" (current routine name for queueing the COMPILE process)
  1. ; IBCNESPD("ITYPE")=Ins Company type (1-Unlinked Insurance Companies, 2-Linked Insurance Companies)
  1. ; IBCNESPD("IMAT")=Partial matching Ins carriers
  1. ; IBCNESPD("IBOUT")=Output Format ('E'- Excel, 'R' - Report)
  1. ; IBCNESPD("ISORT")=Primary Sort (1-Insurance Company Name, 2-Payer Name, 3-VA National Payer ID)
  1. ;
  1. Q
  1. ;
  1. EN ; Main entry pt
  1. ; Init vars
  1. N IBCNERTN
  1. S IBCNERTN="IBCNERPD"
  1. ;
  1. W @IOF
  1. ;IB*2*687/DTG - Add IIU to the report message display
  1. W !,"Insurance Company Link Report",!
  1. W !,"In order for an Insurance Company to be eligible for electronic insurance"
  1. W !,"eligibility communications via the eIV software or to transmit active"
  1. W !,"insurance to another VAMC via IIU, the Insurance Company needs to be"
  1. W !,"linked to an appropriate payer from the National EDI Payer list."
  1. W !,"The National EDI Payer list contains the names of the payers that are"
  1. W !,"currently participating with the eIV and/or IIU process."
  1. W !!,"This report option provides information to assist with finding unlinked"
  1. W !,"insurance companies or payers, which can subsequently be linked through the"
  1. W !,"INSURANCE COMPANY EDIT option."
  1. ;
  1. R10 ; Prompt to select linked vs unlinked insurance companies report option
  1. N IBCNESPD,DEST,IBOUT,POP,STOP,ZTQUEUED,ZTREQ,ZTSTOP
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. S STOP=0
  1. ;
  1. S DIR(0)="S^1:Unlinked insurance companies;2:Linked insurance companies"
  1. S DIR("A")="Select type of companies to display"
  1. S DIR("?",1)=" 1 - Only insurance companies that are not currently linked to a payer"
  1. S DIR("?")=" 2 - Only insurance companies that are currently linked to a payer"
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G EXIT
  1. S IBCNESPD("ITYPE")=Y
  1. I Y=1 S IBCNESPD("ISORT")=1 ; If Unlinked report the sort defaults to the primary sort and skip the sort prompt.
  1. ;
  1. ;IB*752/TAZ - Modified prompt to add Select Ins Co.
  1. R15 ;Prompt for All, Keyword search or Select Ins Co.
  1. ;
  1. N DIR,X,Y,DIRUT
  1. W !
  1. S DIR(0)="S^1:ALL insurance companies;2:Keyword search in insurance companies;3:Select insurance companies"
  1. S DIR("A")="Select companies to display"
  1. S DIR("?",1)=" Enter 1 - Select ALL insurance companies"
  1. S DIR("?",2)=" Enter 2 - Text entered into the search keyword field will"
  1. S DIR("?",3)=" result in the report selecting all insurance"
  1. S DIR("?",4)=" companies that contain the entered text in the"
  1. S DIR("?",5)=" insurance company name."
  1. S DIR("?",6)=" Enter 3 - Individually select insurance companies"
  1. S DIR("?")=" (multiple companies allowed)"
  1. D ^DIR K DIR
  1. I $D(DUOUT)!$D(DTOUT) S Y="" S STOP=1 G:$$STOP^IBCNERP1 EXIT G R10
  1. I Y=1 S IBCNESPD("IMAT")="" G R30
  1. I Y=2 G R20
  1. G R25
  1. ;
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. R20 ; Prompt for Insurance Company Search
  1. N DIR,X,Y,DIRUT
  1. ;
  1. W !!,"Text entered into the search keyword field will result in"
  1. W !,"the report selecting all insurance companies that contain"
  1. W !,"the entered text in the insurance company name."
  1. W !
  1. S DIR(0)="F"
  1. S DIR("A")="Enter an insurance company search keyword"
  1. S DIR("?",1)=" Enter a keyword to search insurance company names that"
  1. S DIR("?",2)=" contain the keyword. Examples of keyword: ('CIGNA' would"
  1. S DIR("?",3)=" return CIGNA, CIGNA HICN, NATIONAL CIGNA, REGION 1 CIGNA"
  1. S DIR("?")=" and any others with the term 'CIGNA' in it)"
  1. D ^DIR K DIR
  1. I $D(DUOUT)!$D(DTOUT) S Y="" S STOP=1 G:$$STOP^IBCNERP1 EXIT G R15
  1. S IBCNESPD("IMAT")=Y
  1. G R30
  1. ;
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. R25 ;Initialize Prompt for insurance companies.
  1. N ARRAY
  1. ;
  1. R26 ; Prompt for multiple insurance companies
  1. ;
  1. D INSOCAS^IBCNINSC(.ARRAY)
  1. ;
  1. I $G(ARRAY)="^" S STOP=1 G:$$STOP^IBCNERP1 EXIT G R15
  1. I '$G(ARRAY) W !,"This is a required response. Enter '^' to exit" G R26
  1. ;
  1. S ARRAY=""
  1. M IBCNESPD("IMAT")=ARRAY
  1. ;
  1. R30 ; Prompt to allow users to select output format
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S IBCNESPD("ISORT")=$S(IBCNESPD("ITYPE")=1:1,1:"")
  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 K DIR
  1. I $D(DIRUT) S STOP=1
  1. I STOP S IBCNESPD("ISORT")="" G:$$STOP^IBCNERP1 EXIT G R15
  1. S (IBOUT,IBCNESPD("IBOUT"))=Y
  1. ;
  1. ; If the report is in EXCEL format, set the sort to the primary sort and skip the Sort Prompt.
  1. I IBCNESPD("IBOUT")="E" S IBCNESPD("ISORT")=1
  1. ; If Unlinked Report or EXCEL format, this skips over SORT prompt.
  1. I IBCNESPD("ITYPE")=1!$G(IBCNESPD("ISORT"))=1 G R50
  1. ;
  1. R40 ; Prompt to allow users to select primary sort
  1. N DIR,X,Y,DIRUT
  1. ;
  1. S DIR(0)="S^1:Insurance Company Name;2:Payer Name;3:VA National Payer ID"
  1. S DIR("A")="Select the primary sort field"
  1. S DIR("B")=1
  1. S DIR("?")=" Select the data field by which this report should be primarily sorted."
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G:$$STOP^IBCNERP1 EXIT G R30
  1. S IBCNESPD("ISORT")=Y
  1. ;
  1. R50 ; Proceed to compilation of the data and then generate the output of the report.
  1. I '$D(ZTQUEUED),IBOUT="R" D
  1. . W ! I IBCNESPD("ITYPE")=2 W !,"*** This report is 132 characters wide ***",!
  1. I IBOUT="E" W !!!,"*** To avoid wrapping, enter '0;256;999' at the 'DEVICE' prompt. ***",!
  1. D DEVICE(IBCNERTN,.IBCNESPD)
  1. ;IB*752/TAZ - When ^ entered, don't return to prompts.
  1. ;I STOP D G @DEST
  1. ;. I $$STOP^IBCNERP1 S DEST="EXIT" Q
  1. ;. I IBCNESPD("ITYPE")=1 S DEST="R30" Q
  1. ;. I IBCNESPD("IBOUT")="E" S DEST="R30" Q
  1. ;. S DEST="R40"
  1. ;
  1. EXIT ; Exit pt
  1. Q
  1. ;
  1. DEVICE(IBCNERTN,IBCNESPD) ; Device Handler and possible TaskManager calls
  1. ; Input params:
  1. ; IBCNERTN = Routine name for ^TMP($J,...
  1. ; IBCNESPD = Array passed by ref of the report params
  1. ; IBOUT = "R" for Report format or "E" for Excel format
  1. ;
  1. N POP,ZTDESC,ZTRTN,ZTSAVE
  1. ;
  1. S ZTRTN="COMPILE^IBCNERPD("""_IBCNERTN_""",.IBCNESPD)"
  1. S ZTDESC="IBCNE Insurance Company Link Report"
  1. S ZTSAVE("IBCNESPD(")=""
  1. S ZTSAVE("IBCNERTN")=""
  1. S ZTSAVE("IBOUT")=""
  1. D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
  1. ;IB*752/TAZ - STOP Variable no longer required since not moving to previous prompts.
  1. ;I POP S STOP=1
  1. Q
  1. ;
  1. COMPILE(IBCNERTN,IBCNESPD) ;
  1. ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
  1. ; Input params:
  1. ; IBCNERTN = Routine name for ^TMP($J,...
  1. ; IBCNESPD = Array passed by ref of the report params
  1. ;
  1. ; Init scratch globals
  1. K ^TMP($J,IBCNERTN)
  1. ; Compile Data
  1. D COMPDATA(IBCNERTN,.IBCNESPD)
  1. ; Print Data
  1. I '$G(ZTSTOP) D OUTPUT(IBCNERTN,.IBCNESPD)
  1. ; Close device
  1. D ^%ZISC
  1. ; Kill scratch globals
  1. K ^TMP($J,IBCNERTN)
  1. ; Purge task record
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. Q
  1. ;
  1. COMPDATA(IBCNERTN,IBCNESPD) ; Compile data
  1. N IBI,IBGRP,IBMAT,IBINAME,IBINS,IBPY,IBPYR,IBSORT,IBTYP
  1. N IBELOACT,IBENAACT,IBIADDR,IBICITY,IBIINST,IBINAACT,IBIPROF,IBISTATE,IBIZIP
  1. N APPEIV,APPIENS,APPIIU,IBPINST,IBPPROF,IBPVAID,IBPYARY,IBRPT,SORT1,SORT2,SORT3
  1. ;
  1. I '$D(ZTQUEUED),$G(IOST)["C-",IBOUT="R" W !!,"Compiling report data ..."
  1. ;
  1. ; Kill scratch globals
  1. K ^TMP($J,IBCNERTN)
  1. ;
  1. S IBTYP=$G(IBCNESPD("ITYPE"))
  1. S IBSORT=$G(IBCNESPD("ISORT"))
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. M IBMAT=IBCNESPD("IMAT")
  1. S (SORT1,SORT2,SORT3)=""
  1. ;
  1. ; Loop thru the Insurance company file
  1. S IBINS=0
  1. F S IBINS=$O(^DIC(36,IBINS)) Q:'IBINS D Q:$G(ZTSTOP)
  1. . I $D(ZTQUEUED),$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . S IBINAME=$$GET1^DIQ(36,IBINS,.01,"I")
  1. . I IBINAME="" Q
  1. . I IBMAT'="",'$F($$UP^XLFSTR(IBINAME),$$UP^XLFSTR(IBMAT)) Q ; ICR #10104
  1. . ; IB*752/TAZ - Modified for Select Ins Co.
  1. . I $D(IBMAT)>10,'$D(IBMAT(IBINS)) Q ;IB*743/TAZ - Not a selected insurance co.
  1. . ; Get active group count
  1. . S (IBI,IBGRP)=0 F S IBI=$O(^IBA(355.3,"B",IBINS,IBI)) Q:'IBI I '$$GET1^DIQ(355.3,IBI,.11,"I") S IBGRP=IBGRP+1
  1. . ;
  1. . S (IBENAACT,IBELOACT,IBINAACT,IBPPROF,IBPINST,IBPYR,IBPVAID)=""
  1. . ; Get PROF ID, INST ID and address from Insurance file
  1. . S IBIPROF=$$GET1^DIQ(36,IBINS,3.02,"I") ;Ins co PROF ID
  1. . S IBIINST=$$GET1^DIQ(36,IBINS,3.04,"I") ;Ins co INST ID
  1. . S IBIADDR=$$GET1^DIQ(36,IBINS,.111,"I"),IBIADDR=$E(IBIADDR,1,35)
  1. . S IBICITY=$$GET1^DIQ(36,IBINS,.114,"I"),IBICITY=$E(IBICITY,1,25)
  1. . S IBISTATE=$$GET1^DIQ(5,+$$GET1^DIQ(36,IBINS,.115,"I"),1)
  1. . S IBIZIP=$$GET1^DIQ(36,IBINS,.116,"I")
  1. . ; Get payer
  1. . S IBPY=$$GET1^DIQ(36,IBINS,3.10,"I")
  1. . ; If Unlinked Report and there is a Payer, quit.
  1. . I IBTYP=1,IBPY'="" Q
  1. . ; If Linked Report and there isn't a Payer, quit.
  1. . I IBTYP=2,IBPY="" Q
  1. . ; Linked Report, get data from the Payer File (#365.12)
  1. . I IBTYP=2 D
  1. . . S IBPYR=$$GET1^DIQ(365.12,IBPY,.01,"I") ;Payer Name
  1. . . S IBPVAID=$$GET1^DIQ(365.12,IBPY,.02,"I") ;VA National ID
  1. . . S IBPPROF=$$GET1^DIQ(365.12,IBPY,.05,"I") ;PROF ID (eligibility)
  1. . . S IBPINST=$$GET1^DIQ(365.12,IBPY,.06,"I") ;INST ID
  1. . . ; Get application info
  1. . . K IBPYARY
  1. . . D PAYER^IBCNINSU(IBPY,,"**","I",.IBPYARY)
  1. . . ; Payer EIV app
  1. . . S APPEIV=$$PYRAPP^IBCNEUT5("EIV",IBPY)
  1. . . I APPEIV'="" D
  1. . . . S APPIENS=""_APPEIV_","_IBPY_","_""
  1. . . . S IBENAACT=IBPYARY(365.121,APPIENS,.02,"I")
  1. . . . S IBENAACT=$S(IBENAACT=1:"YES",1:"NO")
  1. . . . S IBELOACT=IBPYARY(365.121,APPIENS,.03,"I")
  1. . . . S IBELOACT=$S(IBELOACT=1:"YES",1:"NO")
  1. . . ; Payer IIU app
  1. . . S APPIIU=$$PYRAPP^IBCNEUT5("IIU",IBPY)
  1. . . I APPIIU'="" D
  1. . . . S APPIENS=""_APPIIU_","_IBPY_","_""
  1. . . . S IBINAACT=IBPYARY(365.121,APPIENS,.02,"I")
  1. . . . S IBINAACT=$S(IBINAACT=1:"YES",1:"NO")
  1. . . ; Linked Report - SORT fields based upon the SORT that was chosen
  1. . . ; IBSORT=1 equals the Primary Sort sequence: IBINAME,IBPYR,IBPVAID
  1. . . ; IBSORT=2 equals the Payer Sort sequence: IBPYR,IBINAME,IBPVAID
  1. . . ; IBSORT=3 equals the VA ID Sort sequence: IBPVAID,IBINAME,IBPYR
  1. . . I IBSORT=1 S SORT1=IBINAME,SORT2=IBPYR,SORT3=IBPVAID
  1. . . I IBSORT=2 S SORT1=IBPYR,SORT2=IBINAME,SORT3=IBPVAID
  1. . . I IBSORT=3 S SORT1=IBPVAID,SORT2=IBINAME,SORT3=IBPYR
  1. . . I SORT1="" S SORT1=" "
  1. . I IBOUT="E" S SORT1=IBINAME,SORT2=IBPYR,SORT3=IBPVAID
  1. . ;
  1. . ; The Unlinked Report doesn't contain Payer info
  1. . I IBTYP=1 S (SORT1,SORT2,SORT3)=$S(IBINAME'="":IBINAME,1:" ")
  1. . ;
  1. . ; The Unlinked report only uses (IBGRP-IBIZIP). The REPORT format uses all fields
  1. . S IBRPT=IBINAME_U_IBGRP_U_IBIPROF_U_IBIINST_U_IBIADDR_U_IBICITY_U_IBISTATE_U_IBIZIP
  1. . S IBRPT=IBRPT_U_IBPYR_U_IBPVAID_U_IBENAACT_U_IBINAACT_U_IBELOACT_U_IBPPROF_U_IBPINST
  1. . S ^TMP($J,IBCNERTN,SORT1,SORT2,SORT3,IBINS)=IBRPT
  1. Q
  1. ;
  1. OUTPUT(IBCNERTN,IBCNESPD) ; Sets IO params for printing
  1. N IBMAT,IBPGC,IBPXT,IBSORT,IBTYP
  1. N CRT,DIR,DTOUT,DUOUT,LIN,MAXCNT,X,Y,ZZ
  1. ;
  1. S IBTYP=$G(IBCNESPD("ITYPE"))
  1. S IBSORT=$G(IBCNESPD("ISORT"))
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. M IBMAT=IBCNESPD("IMAT")
  1. ;
  1. S (CRT,IBPGC,IBPXT,MAXCNT)=0 ;S (IBPXT,IBPGC)=0
  1. ;
  1. ; Determine IO params
  1. I "^R^E^"'[(U_$G(IBOUT)_U) S IBOUT="R"
  1. I IOST["C-" S MAXCNT=IOSL-3,CRT=1
  1. E S MAXCNT=IOSL-6,CRT=0
  1. D PRINT(IBCNERTN,IBTYP,IBSORT,.IBPGC,.IBPXT,MAXCNT,CRT,IBOUT)
  1. I $G(ZTSTOP)!IBPXT G OUTPUTX
  1. I CRT,IBPGC>0,'$D(ZTQUEUED) D
  1. . I MAXCNT<51 F LIN=1:1:(MAXCNT-$Y) W !
  1. . S DIR(0)="E" D ^DIR K DIR
  1. I IBOUT="E",CRT,'$D(ZTQUEUED) S DIR(0)="E" D ^DIR K DIR ; End of Excel Report
  1. OUTPUTX ; Exit pt
  1. Q
  1. ;
  1. PRINT(RTN,IBTYP,SRT,PGC,PXT,MAX,CRT,IBOUT) ; Print data
  1. ; Input: RTN="IBCENRPB", PGC=page ct,
  1. ; PXT=exit flg, MAX=max line ct/pg,
  1. ; CRT=1/0, IBOUT="R"/"E"
  1. N CNT,DASH,EORMSG,NONEMSG,SORT1,SORT2,SORT3,SPACES
  1. S EORMSG="*** END OF REPORT ***"
  1. S NONEMSG="* * * N O D A T A F O U N D * * *"
  1. S $P(DASH,"-",133)="",$P(SPACES," ",132)=""
  1. ;
  1. ;Excel header
  1. I IBOUT="E" D EHDR
  1. ;
  1. ; If No Data
  1. I '$D(^TMP($J,RTN)) D HEADER:(IBOUT="R") W !,?(80-$L(NONEMSG)\2),NONEMSG,!!
  1. ;
  1. S SORT1="" F S SORT1=$O(^TMP($J,RTN,SORT1)) Q:SORT1="" D Q:PXT!$G(ZTSTOP)
  1. . S SORT2="" F S SORT2=$O(^TMP($J,RTN,SORT1,SORT2)) Q:SORT2="" D Q:PXT!$G(ZTSTOP)
  1. . . S SORT3="" F S SORT3=$O(^TMP($J,RTN,SORT1,SORT2,SORT3)) Q:SORT3="" D Q:PXT!$G(ZTSTOP)
  1. . . . S CNT="" F S CNT=$O(^TMP($J,RTN,SORT1,SORT2,SORT3,CNT)) Q:CNT="" D Q:PXT!$G(ZTSTOP)
  1. . . . . K DISPDATA ; Init disp
  1. . . . . D DATA(.DISPDATA),LINE(.DISPDATA)
  1. ;
  1. I $G(ZTSTOP)!PXT G PRINTEX
  1. I IBOUT="R" D
  1. . I $Y+1>MAX!('PGC) D HEADER I $G(ZTSTOP)!PXT G PRINTEX
  1. W !,?(80-$L(EORMSG)\2),EORMSG
  1. PRINTEX ;
  1. Q
  1. ;
  1. DATA(DISPDATA) ; Build display lines
  1. N ADDRESS,I,LCT,RPTDATA,ZIPCODE
  1. ; Merge into local variable
  1. M RPTDATA=^TMP($J,RTN,SORT1,SORT2,SORT3,CNT)
  1. ;
  1. ; Format Zip Codes, add a "-" after the first 5 digits and before the last 4 digits (99999-9999)
  1. S ZIPCODE=$E($P(RPTDATA,U,8),1,5)
  1. I $L($P(RPTDATA,U,8))>5 S ZIPCODE=$E($P(RPTDATA,U,8),1,5)_"-"_$E($P(RPTDATA,U,8),6,9)
  1. ;
  1. ; Excel format for Unlinked and Linked Reports
  1. I IBOUT="E" D Q
  1. . S LCT=1,DISPDATA(1)=$P(RPTDATA,U)_U_$P(RPTDATA,U,5)_U_$P(RPTDATA,U,6)
  1. . S DISPDATA(1)=DISPDATA(1)_U_$P(RPTDATA,U,7)_U_ZIPCODE
  1. . S DISPDATA(1)=DISPDATA(1)_U_$P(RPTDATA,U,2)_U_$P(RPTDATA,U,3)_U_$P(RPTDATA,U,4)
  1. . I IBTYP=2 D
  1. . . F I=9:1:$L(RPTDATA,U) S DISPDATA(1)=DISPDATA(1)_U_$P(RPTDATA,U,I)
  1. ;
  1. ; Report format (Address(35), City(25), State(2) Zip Code
  1. S ADDRESS=$E($P(RPTDATA,U,5),1,35)_" "_$E($P(RPTDATA,U,6),1,25)_", "_$$LJ^XLFSTR($P(RPTDATA,U,7),"2T")_$E(SPACES,1,1)_$$LJ^XLFSTR(ZIPCODE,"10T")
  1. ;
  1. ; Unlinked Report
  1. I IBTYP=1 D
  1. . ; Line 1 - Ins co, # Active Groups, Claim Prof EDI#, Claim Inst EDI#
  1. . S DISPDATA(1)=$$LJ^XLFSTR($P(RPTDATA,U),"30T")_$E(SPACES,1,2)_$$RJ^XLFSTR($P(RPTDATA,U,2),5)
  1. . S DISPDATA(1)=DISPDATA(1)_$E(SPACES,1,18)_$$RJ^XLFSTR($P(RPTDATA,U,3),5)
  1. . S DISPDATA(1)=DISPDATA(1)_$E(SPACES,1,12)_$$RJ^XLFSTR($P(RPTDATA,U,4),5)
  1. . ; line 2 - Ins co Address
  1. . S DISPDATA(2)=$E(SPACES,1,9)_ADDRESS
  1. . ; line 3 - blank
  1. . S DISPDATA(3)=" "
  1. ; Linked Report
  1. I IBTYP=2 D
  1. . ; Line 1 - Ins Co(30),# Active Grps, Address line 1, City, ST, Zip, Prof/Inst EDI#
  1. . S DISPDATA(1)=$$LJ^XLFSTR($P(RPTDATA,U),"30T")_$E(SPACES,1,1)_$$RJ^XLFSTR($P(RPTDATA,U,2),5)
  1. . S DISPDATA(1)=DISPDATA(1)_$E(SPACES,1,4)_$$LJ^XLFSTR(ADDRESS,"68T")
  1. . I $P(RPTDATA,U,3)'=""!$P(RPTDATA,U,4) D
  1. . . S DISPDATA(1)=DISPDATA(1)_$E(SPACES,1,1)_$$RJ^XLFSTR($P(RPTDATA,U,3),5)_"/"_$$LJ^XLFSTR($P(RPTDATA,U,4),5)
  1. . ; Line 2 - Payer Name(31),VA ID,eIV Natl Enabled,IIU Natl Enabled,eIV Loc Enabled,EligProf/Inst EDI#
  1. . S DISPDATA(2)=$E(SPACES,1,2)_$$LJ^XLFSTR($P(RPTDATA,U,9),"31T")_$E(SPACES,1,11)_$$LJ^XLFSTR($P(RPTDATA,U,10),10)
  1. . S DISPDATA(2)=DISPDATA(2)_$E(SPACES,1,1)_$$LJ^XLFSTR($P(RPTDATA,U,11),3)_$E(SPACES,1,17)_$$LJ^XLFSTR($P(RPTDATA,U,12),3)
  1. . S DISPDATA(2)=DISPDATA(2)_$E(SPACES,1,16)_$$LJ^XLFSTR($P(RPTDATA,U,13),3)
  1. . I $P(RPTDATA,U,14)'=""!$P(RPTDATA,U,15) D
  1. . . S DISPDATA(2)=DISPDATA(2)_$E(SPACES,1,12)_$$RJ^XLFSTR($P(RPTDATA,U,14),5)_"/"_$$RJ^XLFSTR($P(RPTDATA,U,15),5)
  1. . ; line 3 - blank
  1. . S DISPDATA(3)=" "
  1. ;
  1. Q
  1. ;
  1. LINE(DISPDATA) ; Print data
  1. N LNCT,LNTOT,NWPG
  1. S LNTOT=+$O(DISPDATA(""),-1)
  1. S NWPG=0
  1. F LNCT=1:1:LNTOT D I $G(ZTSTOP)!PXT W ! Q
  1. . I IBOUT="R" D Q:$G(ZTSTOP)!PXT
  1. . . I $Y+1>MAX!('PGC) D HEADER S NWPG=1 I $G(ZTSTOP)!PXT Q
  1. . W ! W:IBOUT="R" ?1 W DISPDATA(LNCT) Q
  1. . I 'NWPG!(NWPG&(DISPDATA(LNCT)'="")) W !,?1,DISPDATA(LNCT)
  1. . I NWPG S NWPG=0
  1. . Q
  1. Q
  1. ;
  1. N DIR,DTOUT,DUOUT,HDR,LIN,OFFSET,X,Y
  1. I CRT,PGC>0,'$D(ZTQUEUED) D I PXT G HEADERX
  1. . I MAX<51 F LIN=1:1:(MAX-$Y) W !
  1. . S DIR(0)="E" D ^DIR K DIR
  1. . I $D(DTOUT)!($D(DUOUT)) S PXT=1 Q
  1. I $D(ZTQUEUED),$$S^%ZTLOAD() S ZTSTOP=1 G HEADERX
  1. S PGC=PGC+1
  1. W @IOF,!,"Insurance Company Link Report"
  1. S HDR=$$FMTE^XLFDT($$NOW^XLFDT,1)_" Page: "_PGC
  1. S OFFSET=$S(IBTYP=2:131,1:79)-$L(HDR)
  1. W ?OFFSET,HDR
  1. W !
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. S HDR=$S(IBTYP=1:"Unlinked Insurance Companies",1:"Linked Insurance Companies")
  1. S HDR=HDR_" - "_$S(($D(IBMAT)>10):"Selected",IBMAT="":"ALL",1:"that contain: "_IBMAT)
  1. S OFFSET=$S(IBTYP=2:131,1:79)-$L(HDR)/2
  1. W ?OFFSET,HDR
  1. W !
  1. I IBTYP=1 D
  1. . W !?32,"# Active",?56,"Prof.",?74,"Inst."
  1. . ;IB*2*687/DTG remove ':' after the Insurance Company in header
  1. . W !,"Insurance Company",?33,"Groups",?56,"EDI#",?74,"EDI#"
  1. . W !,$E(DASH,1,80)
  1. ;
  1. I IBTYP=2 D
  1. . ;IB*2*687/DTG remove ':' from the Insurance Company in header
  1. . ;W !,"Insurance Company:",?32,"# Active",?56,"eIV Nationally",?75,"IIU Nationally"
  1. . W !,"Insurance Company",?32,"# Active",?56,"eIV Nationally",?75,"IIU Nationally"
  1. . W ?94,"eIV Locally",?110,"Prof/Inst EDI#"
  1. . ;IB*2*687/DTG remove ':' after the Payer Name in header
  1. . W !," Payer Name",?32,"Groups",?45,"VA ID",?56,"Enabled",?76,"Enabled",?95,"Enabled"
  1. . W !,DASH
  1. HEADERX ;
  1. Q
  1. ;
  1. EHDR ; - Excel format Header
  1. N HDR,X
  1. S X="Insurance Company Link Report^"_$$FMTE^XLFDT($$NOW^XLFDT,1)
  1. W X,!
  1. S HDR=$S(IBTYP=1:"Unlinked Insurance Companies",1:"Linked Insurance Companies")
  1. ; IB*752/TAZ - Modified for Select Ins Co.
  1. S HDR=HDR_" - "_$S(($D(IBMAT)>10):"Selected",IBMAT="":"ALL",1:"that contain: "_IBMAT)
  1. W HDR
  1. S X="Insurance Company^Street Address^City^State^Zip^# Active Groups^Claims Prof EDI#^Claims Inst EDI#"
  1. ; Unlinked Report
  1. I IBTYP=1 W !,X Q
  1. ; Linked Report - add addt'l fields
  1. I IBTYP=2 D
  1. . S X=X_"^Payer Name^VA ID^eIV Nationally Enabled^IIU Nationally Enabled^eIV Locally Enabled^"
  1. . S X=X_"Eligibility Prof EDI#^Eligibility Inst EDI#"
  1. . W !,X
  1. Q