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

IBCOPP.m

Go to the documentation of this file.
  1. IBCOPP ;ALB/NLR - LIST INS. PLANS BY CO. (DRIVER) ; 20-OCT-2015
  1. ;;2.0;INTEGRATED BILLING;**28,62,528,549**;21-MAR-94;Build 54
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. EN ; Describe report
  1. ; IB*2.0*549 - reworded report description
  1. W !!?5,"This report will generate a list of insurance plans by company."
  1. W !?5,"It will help you identify duplicates. You must select one, many"
  1. W !?5,"or all of the insurance companies; anywhere from one to all of the"
  1. W !?5,"plans under each company; and whether to include the patient policies"
  1. W !?5,"(subscribers) under each plan. The number of plans you select is "
  1. W !?5,"independent for each company you are including, but the subscriber"
  1. W !?5,"is the same (all or none) for all companies and plans within this report."
  1. W !?5,"Regardless of how you run the report, the number of group plans per"
  1. W !?5,"insurance company and the number of subscribers per plan will be"
  1. W !?5,"included.",!!
  1. ;
  1. ; Prompt user to select report type, insurance companies, plans
  1. ;
  1. ; Output from user selections:
  1. ;
  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 with Subscriber
  1. ; information
  1. ; IBAI= 0 - User selected Insurance Companies
  1. ; 1 - Run report for all Insurance Companies with Plans
  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. ; IBAPL= 0 - Whether some or all ins. co's., user selects plans (may be
  1. ; all for certain companies, some for other companies)
  1. ; 1 - Whether some or all ins. co's., run report for all plans
  1. ; associated with those co's.
  1. ;
  1. N A,I,IBAO,POP,ZTDESC,ZTDEXC,ZTRTN,ZTSAVE,%ZIS
  1. K ^TMP("IBINC",$J)
  1. S IBAPA=$$SELR^IBCOPP1 ; Report Type prompt
  1. I IBAPA<0 D ENQ Q
  1. S IBAI=$$SELI^IBCOPP1 ; All/Selected Ins. Cos. prompt
  1. I IBAI<0 D ENQ Q
  1. ;
  1. ; IB*2.0*549 - Inactive/Active/Both Insurance Company look-up filter
  1. ; Only ask if user didn't select all Insurance Companies
  1. S IBAIA=$$SELA^IBCOPP1
  1. I IBAIA<0 D ENQ Q
  1. ;
  1. ; IB*2.0*549 - Added call to Insurance Company look-up listman template
  1. ; for selecting, moved from START method
  1. ; Allow user selection of Insurance Companies, if required
  1. I 'IBAI D I IBQUIT=1 D ENQ Q
  1. . N IBCNS,XX
  1. . S IBQUIT=0
  1. . D EN^IBCNILK(IBAIA)
  1. . I '$D(^TMP("IBCNILKA",$J)) S IBQUIT=1 Q ; No Insurance Companies selected
  1. . S IBCNS=""
  1. . F S IBCNS=$O(^TMP("IBCNILKA",$J,IBCNS)) Q:IBCNS="" D
  1. . . ;
  1. . . ; Insurance Company Name
  1. . . S XX=$E($$GET1^DIQ(36,IBCNS_",",.01),1,25)
  1. . . S ^TMP("IBINC",$J,XX,IBCNS)=""
  1. . K ^TMP("IBCNILKA",$J)
  1. ;
  1. S IBAPL=$$SELP^IBCOPP1 ; Plan Selection prompt
  1. I IBAPL<0 D ENQ Q
  1. ;
  1. ; IB*2.0*549 - Inactive/Active/Both Insurance Company Plan look-up filter
  1. ; Only ask if user didn't select all Group Plan
  1. S IBAIPA=2
  1. S:'IBAPL IBAIPA=$$SELPA^IBCOPP1
  1. I IBAIPA<0 D ENQ Q
  1. ;
  1. ; All Insurance Companies, All Plans, skip to device prompt
  1. I IBAI,IBAPL D Q
  1. . S IBAO=$$OUT^IBCOPP1 ; Report or CSV output
  1. . I IBAO<0 D ENQ Q
  1. . D DEVICE
  1. ;
  1. ; Obtain Plans for selected or All Insurance Companies
  1. D START
  1. I IBQUIT D ENQ Q
  1. I '$D(^TMP("IBINC",$J)) D Q
  1. . W !!,*7,"No plans selected!"
  1. . D ENQ
  1. ;
  1. S IBAO=$$OUT^IBCOPP1 ; Report or CSV output
  1. D DEVICE
  1. Q
  1. ;
  1. DEVICE ; Ask user to select device
  1. ;
  1. N I,POP
  1. I IBAO'="E" D
  1. . W !!,"*** You will need a 132 column printer for this report. ***",!
  1. 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. S %ZIS="QM"
  1. D ^%ZIS
  1. I POP D ENQ Q
  1. I $D(IO("Q")) D Q
  1. . S ZTRTN="^IBCOPP2",ZTDESC="IB - LIST OF PLANS BY INSURANCE COMPANY"
  1. . F I="^TMP(""IBINC"",$J,","IBAPA","IBAI","IBAPL","IBAO" S ZTSAVE(I)=""
  1. . D ^%ZTLOAD
  1. . K IO("Q")
  1. . D HOME^%ZIS
  1. . W !!,$S($D(ZTSK):"This job has been queued as task #"_ZTSK_".",1:"Unable to queue this job.")
  1. . K ZTSK,IO("Q")
  1. . D ENQ
  1. ;
  1. ; Compile and print report
  1. U IO
  1. D ^IBCOPP2
  1. ;
  1. ENQ ;
  1. K A,DIRUT,DIROUT,DUOUT,DTOUT,IBAO,IBAI,IBAIA,IBAIPA,IBAPA,IBAPL,IBQUIT,X,Y
  1. K ^TMP("IBCNILKA",$J),^TMP("IBINC",$J)
  1. Q
  1. ;
  1. START ; Gather plans for all selected companies.
  1. ; Input: IBAI - 0 - User selected Insurance Companies
  1. ; 1 - Run report for all Insurance Companies with Plans
  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. ; IBAPL - 0 - Whether some or all ins. co's., user selects plans (may be
  1. ; all for certain companies, some for other companies)
  1. ; 1 - Whether some or all ins. co's., run report for all plans
  1. ; associated with those co's.
  1. S (IBCT,IBQUIT)=0
  1. I IBAPL D STARTQ Q
  1. ;
  1. ; Gather all Insurance Companies if required
  1. I IBAI D
  1. . N INACT
  1. . S A=0
  1. . F S A=$O(^IBA(355.3,"B",A)) Q:'A D
  1. . . Q:$G(^DIC(36,A,0))=""
  1. . . S INACT=+$$GET1^DIQ(36,A_",",.05,"I") ; Is the Insurance Company Inactive?
  1. . . I INACT,IBAIA=1 Q ; IB*2.0*549 Only include Active Ins. Cos.
  1. . . I 'INACT,IBAIA=0 Q ; IB*2.0*549 Only include Inactive Ins. Cos.
  1. . . S ^TMP("IBINC",$J,$E($P($G(^DIC(36,A,0)),"^"),1,25),A)=""
  1. ;
  1. ; Gather plans for selected Insurance Companies
  1. S IBIC=""
  1. F S IBIC=$O(^TMP("IBINC",$J,IBIC)) Q:IBIC=""!IBQUIT D
  1. . S IBCNS=""
  1. . F S IBCNS=$O(^TMP("IBINC",$J,IBIC,IBCNS)) Q:IBCNS=""!(IBQUIT) D
  1. . . S IBCT=IBCT+1
  1. . . W !!,"Insurance Company # "_IBCT_": "_IBIC
  1. . . D OK^IBCNSM3
  1. . . Q:IBQUIT
  1. . . I 'IBOK K ^TMP("IBINC",$J,IBIC,IBCNS) S IBAI=0 Q
  1. . . W " ...building a list of plans..."
  1. . . K IBSEL,^TMP($J,"IBSEL")
  1. . . ;
  1. . . ; IB*2.0*549 - Add Active/Inactive/Both Plan filter
  1. . . S XX=$S(IBAIPA=0:2,IBAIPA=1:0,IBAIPA=2:1)
  1. . . D LKP^IBCNSU2(IBCNS,1,1,.IBSEL,0,XX)
  1. . . Q:IBQUIT
  1. . . I '$O(^TMP($J,"IBSEL",0)) D Q
  1. . . . K ^TMP("IBINC",$J,IBIC,IBCNS)
  1. . . . S IBAI=0
  1. . . ;
  1. . . ; Set plans into an array
  1. . . S IBPN=0
  1. . . F S IBPN=$O(^TMP($J,"IBSEL",IBPN)) Q:'IBPN D
  1. . . . S ^TMP("IBINC",$J,IBIC,IBCNS,IBPN)=""
  1. ;
  1. STARTQ ;
  1. K IBAO,IBCT,IBIC,IBJJ,IBLCT,IBCNS,IBOK,IBPN,IBSEL,^TMP($J,"IBSEL")
  1. Q