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

IBCOPP3.m

Go to the documentation of this file.
  1. IBCOPP3 ;ALB/NLR - LIST INS. PLANS BY CO. (PRINT) ; 20-OCT-2015
  1. ;;2.0;INTEGRATED BILLING;**28,516,528,549**;21-MAR-94;Build 54
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; Print the report.
  1. ; Input: IBAI - 0 - Only Selected Insurance Companies
  1. ; 1 - All Insurance Companies
  1. ; IBAIA - 0 - Only select Inactive Insurance Companies
  1. ; 1 - Only select Active Insurance Companies
  1. ; 2 - Select both Active and Inactive Insurance
  1. ; Companies
  1. ; IBAO - E - Output to Excel
  1. ; R - Report
  1. ; IBAPA - 0 - List Insurance Plans by Insurance Company
  1. ; 1 - List Insurance Plans by Insurance Company
  1. ; with Subscriber information
  1. ; IBAIPA - 0 - Only select Inactive Insurance Company Plans
  1. ; 1 - Only select Active Insurance Company Plans
  1. ; 2 - Select both Active and Inactive Insurance
  1. ; Company Plans
  1. ; IBAPL - 0 - Only list selected plans for Insurance Companies
  1. ; 1 - List all plans for selected Insurance Companies
  1. ; ^TMP($J,"PR" - Global Print Array
  1. ; ^TMP($J,"PR",IBI)=A1^A2^...^A10 Where:
  1. ; IBI - Counter of # of Insurance Companies included
  1. ; (starts at 1)
  1. ; A1 - Insurance Company Name (1st 25 characters)
  1. ; A2 - Street Address Line 1
  1. ; A3 - City, State Zip Code (up to 9 digits + dash)
  1. ; A4 - Timely Filing Timeframe
  1. ; A5 - # of total plans for the Insurance Company
  1. ; A6 - # of total subscribers per Insurance Company
  1. ; A7 - # of selected Plans per Insurance Company
  1. ; A8 - # of subscribers per selected plans
  1. ; A9 - Maximum Length of the Electronic Plan
  1. ; Field for this Insurance Company
  1. ; A10 - Maximum Length of the Type of Plan
  1. ; Field for this Insurance Company
  1. ; A11 - Max length of Patient ID for Ins Co
  1. ; ^TMP($J,"PR",IBI,IBPTR))- B1^B2^..^B6 where
  1. ; IBI - Counter of # of Insurance Companies included
  1. ; IBPTR- Group Plan IEN, file 355.3
  1. ; B1 - Group Number, field 355.3,2.02
  1. ; B2 - Group Name, field 355.3,2.01
  1. ; B3 - Group Plan Timely Filing Time frame (max len 21)
  1. ; B4 - Electronic Plan Type (max length 26)
  1. ; B5 - Type of Plan (max length 34)
  1. ; B6 - Total number of subscribers for Group Plan
  1. ; ^TMP($J,"PR",IBI,IBPTR,IBNAM_"@@"_DFN_"@@"_IBCDFN)=B1^B2^...^B8 Where
  1. ; DFN - IEN of the patient, file 2
  1. ; IBCDFN- Insurance Company multiple
  1. ; IBI - Insurance counter
  1. ; IBNAM - Patient's Name (B1)
  1. ; IBPTR - IEN of the Group Plan, file 355.3
  1. ; B1 - Patient's Name (1st 22 chars)
  1. ; B2 - Last 4 Patient's SSN (with trailing 'P' if pseudo)
  1. ; B3 - Patient's DOB (mm/dd/yy)
  1. ; B4 - Subscriber ID (20 chars max)
  1. ; B5 - Effective Date (mm/dd/yy)
  1. ; B6 - Expiration Date (mm/dd/yy)
  1. ; B7 - Whose Insurance (5 chars max)
  1. ; B8 - Patient ID (30 chars max)
  1. ;
  1. N COLEP,COLFTF,COLPID,TRUNCPT,XX,%
  1. I IBAO="E" D Q
  1. . D EXCEL
  1. . W !!?30,"*** End of Report ***"
  1. ;
  1. S (IBI,IBQUIT,IBPAG)=0
  1. D NOW^%DTC
  1. S IBHDT=$$DAT2^IBOUTL($E(%,1,12))
  1. ;
  1. F S IBI=$O(^TMP($J,"PR",IBI)) Q:'IBI S IBC=$G(^TMP($J,"PR",IBI)) D Q:IBQUIT
  1. . D COMP(.COLEP,.COLFTF,.TRUNCPT)
  1. . S IBP=0
  1. . F S IBP=$O(^TMP($J,"PR",IBI,IBP)) Q:'IBP S IBPD=$G(^(IBP)) D Q:IBQUIT
  1. . . I $Y>(IOSL-$S(IBAPA:9,1:5)) D PAUSE Q:IBQUIT D COMP(.COLEP,.COLFTF,.TRUNCPT)
  1. . . D PLAN(COLEP,COLFTF,TRUNCPT)
  1. . . ;
  1. . . ; Display Subscriber Information
  1. . . I IBAPA D
  1. . . . S XX=$O(^TMP($J,"PR",IBI,IBP,"")) ; Are the subscribers to display
  1. . . . D:XX'="" SUBHDR ; Display Subscriber Headers
  1. . . . S IBS=""
  1. . . . F S IBS=$O(^TMP($J,"PR",IBI,IBP,IBS)) Q:IBS="" D Q:IBQUIT
  1. . . . . S IBSD=$G(^TMP($J,"PR",IBI,IBP,IBS))
  1. . . . . D SUBS
  1. . Q:IBQUIT
  1. . ;
  1. . ; Print company totals
  1. . I $Y>(IOSL-4) D PAUSE Q:IBQUIT D
  1. . . D COMP(.COLEP,.COLFTF,.TRUNCPT)
  1. . . D PLAN(COLEP,COLFTF,TRUNCPT)
  1. . W !!?90,"Number of Plans Selected = ",$P(IBC,"^",7)
  1. . W !?76,"Total Subscribers Under Selected Plans = ",$P(IBC,"^",8)
  1. . D PAUSE
  1. ;
  1. ; IB*2.0*549 - Added next line
  1. W !!?30,"*** End of Report ***"
  1. ;
  1. K IBAIA,IBAIPA,IBAPA,IBJJ,IBI,IBQUIT,IBPAG,IBHDT,IBC,IBP,IBPD,IBS,IBSD
  1. Q
  1. ;
  1. COMP(COLEP,COLFTF,TRUNCPT) ; Print Company header
  1. ; Input: IBC - ^TMP($J,"PR",IBC), see documentation above
  1. ; IBPAG - Current Page Counter
  1. ; IBHDT - Current date/time (external format)
  1. ; IBAIA - 0 - Only select Inactive Insurance Companies
  1. ; 1 - Only select Active Insurance Companies
  1. ; 2 - Select both Active and Inactive Insurance Companies
  1. ; IBAIPA - 0 - Only select Inactive Insurance Company Plans
  1. ; 1 - Only select Active Insurance Company Plans
  1. ; 2 - Select both Active and Inactive Insurance Company Plans
  1. ; IBAPA - 0 - List Insurance Plans by Insurance Company
  1. ; 1 - List Insurance Plans by Insurance Company with
  1. ; Subscriber information
  1. ; Output: COLEP - Starting Column Position of the Electronic Plan Type Col
  1. ; COLFTF - Starting Column Position of the FTF Col
  1. ; TRUNCPT - # of characters to truncate from the Plan Type field (if any)
  1. ; IBPAG - Updated Page Counter
  1. N LENEP,LENPT
  1. K COLEP,COLFTF,TRUNCPT
  1. S LENPT=$P(IBC,"^",9),LENEP=$P(IBC,"^",10)
  1. I $E(IOST,1,2)="C-"!(IBPAG) W @IOF
  1. S IBPAG=IBPAG+1
  1. W !,"LIST OF PLANS BY INSURANCE COMPANY"
  1. W:IBAPA " WITH SUBSCRIBER INFORMATION"
  1. W ?IOM-34,IBHDT,?IOM-10,"Page: ",IBPAG
  1. W !,$TR($J(" ",IOM)," ","-")
  1. ;
  1. ; IB*2.0*549 - Added next 3 lines
  1. W !,"+ =>INDIV. PLAN * => INACTIVE"
  1. W !,"Filters: ",$S(IBAI=1:"All",1:"Selected")," Insurances"
  1. W ", ",$S(IBAPL=1:"All",1:"Selected")," Group Plans",!
  1. ;
  1. ; IB*2.0*549 - Changed fields displayed for each Insurance Company
  1. W !?1,$P(IBC,"^",1) ; Insurance Company Name (26 chars max)
  1. W !?1,$P(IBC,"^",2) ; Street Address line 1 (35 chars max)
  1. W ?45,"FTF = ",$P(IBC,"^",4) ; Timely Filing Timeframe (28 chars max)
  1. W ?105,"GROUP PLAN TOTAL= ",$P(IBC,"^",5)
  1. W !?1,$P(IBC,"^",3) ; City State Zip Code
  1. W ?105,"SUBSCRIBER TOTAL= ",$P(IBC,"^",6)
  1. ;
  1. ; Check to see if the Plan Type and/or Electronic Plan Type fields need to be
  1. ; truncated
  1. S COLEP=$S(LENPT<13:76,LENPT:64+LENPT+3,1:76) ; Elec Plan Col, assuming no truncation
  1. S COLFTF=$S(LENEP<10:COLEP+13,1:COLEP+LENEP+3) ; FTF Col, assuming no truncation
  1. S:'LENEP COLFTF=COLFTF+8
  1. S TRUNCPT=0 ; Assume no truncation needed
  1. I 64+$P(IBC,"^",9)+$P(IBC,"^",10)>103 D
  1. . S TRUNCPT=(64+$P(IBC,"^",10))-103 ; # of Characters to truncate
  1. . S COLEP=(64+$P(IBC,"^",10)+3)-TRUNCPT
  1. . S COLFTF=COLEP+$P(IBC,"^",9)+2 ; FTF Col
  1. W !?5,"GROUP NUMBER",?32,"GROUP NAME",?62,"TYPE OF PLAN"
  1. W ?COLEP,"ELEC PLAN",?COLFTF,"FTF"
  1. Q
  1. ;
  1. PLAN(COLEP,COLFTF,TRUNCPT) ; Print Group Plan information.
  1. ; Input: COLEP - Starting Column Position of the Electronic Plan Type Col
  1. ; COLFTF - Starting Column Position of the FTF Col
  1. ; TRUNCPT - # of characters to truncate from the Plan Type field (if any)
  1. ; IBPD - ^TMP($J,"PR",IBC,IBPTR), see documentation above
  1. ; IBAPA - 0 - List Insurance Plans by Insurance Company
  1. ; 1 - List Insurance Plans by Insurance Company with
  1. ; Subscriber information
  1. ; ^TMP($J,"PR",IBI,IBPTR))- B1^B2^..^B6 where
  1. ; IBI - Counter of # of Insurance Companies included
  1. ; IBPTR- Group Plan IEN
  1. ; B1 - Group Number, field 355.3,2.02
  1. ; B2 - Group Name, field 355.3,2.01
  1. ; B3 - Group Plan Timely Filing Time frame (max len 21)
  1. ; B4 - Electronic Plan Type (max length 26)
  1. ; B5 - Type of Plan (max length 40)
  1. ; B6 - Total # of subscribers for Group Plan
  1. ;
  1. ; IB*2.0*549 - Changed fields displayed for each Group Plan
  1. N XX
  1. W !?5,$P(IBPD,"^",1) ; Group Plan Number
  1. W ?32,$P(IBPD,"^",2) ; Group Plan Name
  1. S XX=$P(IBPD,"^",5)
  1. S:TRUNCPT XX=$E(XX,1,$L(XX)-TRUNCPT)
  1. W ?62,XX ; Type of Plan (40 Chars max)
  1. W ?COLEP,$P(IBPD,"^",4) ; Electronic Plan Type (26 Chars max)
  1. W ?COLFTF,$P(IBPD,"^",3) ; Group Plan FTF (26 Chars max)
  1. W !?10,"SUBSCRIBERS = ",$P(IBPD,"^",6) ; Group Plan Subscriber total
  1. Q
  1. ;
  1. SUBHDR ; Print the Subscriber Header Line
  1. ; IB*2.0*549 New Method
  1. W !?10,"SUBSCRIBER NAME",?35,"SSN",?43,"DOB",?53,"SUB ID",?76,"EFF",?86,"EXP"
  1. W ?96,"WHO",?102,"PAT ID"
  1. Q
  1. ;
  1. SUBS ; Print subscriber information.
  1. ; IB*2.0*549 Changed fields displayed
  1. ; Input: IBSD - Subscriber detail - ^TMP($J,"PR",IBI,IBP,IBS)
  1. ; Subscriber ID to display more characters.
  1. N COLEP,COLFTF,TRUNCPT
  1. I $Y>(IOSL-4) D PAUSE Q:IBQUIT D
  1. . D COMP(.COLEP,.COLFTF,.TRUNCPT)
  1. . D PLAN(COLEP,COLFTF,TRUNCPT)
  1. . D SUBHDR
  1. W !?10,$P(IBSD,"^",1),?35,$P(IBSD,"^",2),?43,$P(IBSD,"^",3),?53,$P(IBSD,"^",4)
  1. W ?76,$P(IBSD,"^",5),?86,$P(IBSD,"^",6),?96,$P(IBSD,"^",7),?102,$P(IBSD,"^",8)
  1. Q
  1. ;
  1. PAUSE ; Pause for screen output.
  1. ; Input: None
  1. ; Output: IBQUIT - 1 if user timed out or entered '^'
  1. N DIR,DIRUT,DTOUT,DUOUT,IBJJ
  1. Q:$E(IOST,1,2)'["C-"
  1. S DIR(0)="E"
  1. D ^DIR K DIR
  1. I $D(DIRUT)!($D(DUOUT)) D
  1. . S IBQUIT=1
  1. Q
  1. ;
  1. EXCEL ; Output in excel format
  1. N HDR,IBC,IBHDT,IBP,IBPD,IBS,IBSD
  1. D NOW^%DTC
  1. S IBHDT=$$DAT2^IBOUTL($E(%,1,12))
  1. ;
  1. ; Set Report Header into output
  1. W !,"LIST OF PLANS BY INSURANCE COMPANY"
  1. W:IBAPA " WITH SUBSCRIBER INFORMATION"
  1. W " Run On: ",IBHDT
  1. ;
  1. ; Set filter into output
  1. ; IB*2.0*549 - Added next 3 lines
  1. W !,"+ =>INDIV. PLAN * => INACTIVE"
  1. W !,"Filters: ",$S(IBAI=1:"All",1:"Selected")," Insurances"
  1. W ", ",$S(IBAPL=1:"All",1:"Selected")," Group Plans",!
  1. ;
  1. S HDR="INS. CO.^ADDRESS^CITY,STATE ZIP^FTF^PLAN TOTAL^SUBS TOTAL^PLANS SELECTED^TOT SUBS"
  1. S HDR=HDR_"^GROUP NUMBER^GROUP NAME^FTF^ELEC PLAN^TYPE OF PLAN^NO. SUBS"
  1. I IBAPA S HDR=HDR_"^SUBSCRIBER NAME^SSN^DOB^SUB ID^EFF DT^EXP DT^WHOSE INS^PAT ID"
  1. W !,HDR
  1. S IBI=0
  1. F S IBI=$O(^TMP($J,"PR",IBI)) Q:'IBI S IBC=$G(^TMP($J,"PR",IBI)) D
  1. . S IBC=$P(IBC,"^",1,8),IBP=0
  1. . F S IBP=$O(^TMP($J,"PR",IBI,IBP)) Q:'IBP S IBPD=$G(^TMP($J,"PR",IBI,IBP)) D
  1. . . I 'IBAPA W !,IBC_U_IBPD Q
  1. . . S IBS=""
  1. . . F S IBS=$O(^TMP($J,"PR",IBI,IBP,IBS)) Q:IBS="" S IBSD=$G(^TMP($J,"PR",IBI,IBP,IBS)) D
  1. . . . W !,IBC_U_IBPD_U_IBSD
  1. Q