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

IBCMDT.m

Go to the documentation of this file.
  1. IBCMDT ;ALB/VD - INSURANCE PLANS MISSING DATA REPORT (DRIVER) ; 10-APR-15
  1. ;;2.0;INTEGRATED BILLING ;**549,763**; 10-APR-15;Build 29
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; IB - Insurance Plans Missing Data Report.
  1. ;
  1. ;Input parameters: N/A
  1. ;
  1. ;Other relevant variables:
  1. ; ZTSAVED for queuing
  1. ;
  1. ; IBMDTSPC("FLTRS") n where n is the number of filters selected
  1. ; IBMDTSPC("IBAI") 0 = user selected insurance companies.
  1. ; 1 = all insurance companies w/plans.
  1. ;
  1. ; IBMDTSPC("IBAPL") 0 = user selected plans (may be ALL for certain companies, some for other companies).
  1. ; 1 = all plans for the insurance companies (all or selected).
  1. ;
  1. ; IBMDTSPC("IBGRN") 0 = ignore Missing Group Number filter.
  1. ; 1 = include Missing Group Number filter.
  1. ;
  1. ; IBMDTSPC("IBPTY") 0 = ignore Missing Type of Plan filter.
  1. ; 1 = include Missing Type of Plan filter.
  1. ;
  1. ; IBMDTSPC("IBTFT") 0 = ignore Missing Timely Filing Time Frame filter.
  1. ; 1 = include Missing Timely Filing Time Frame filter.
  1. ;
  1. ; IBMDTSPC("IBEPT") 0 = ignore Missing Electronic Plan Type filter.
  1. ; 1 = include Missing Electronic Plan Type filter.
  1. ;
  1. ; IBMDTSPC("IBCLM") 0 = ignore Missing Coverage Limitation filter.
  1. ; 1 = include Missing Coverage Limitation filter.
  1. ;
  1. ; IBMDTSPC("IBBIN") 0 = ignore Missing BIN (Banking Identification Number) filter.
  1. ; 1 = include Missing BIN (Banking Identification Number) filter.
  1. ;
  1. ; IBMDTSPC("IBPCN") 0 = ignore Missing PCN (Processor Control Number) filter.
  1. ; 1 = include Missing PCN (Processor Control Number) filter.
  1. ; IBMDTSPC("IBNMSPC") = $J of the parent job (if queued)
  1. ;
  1. EN ; Main Entry point.
  1. ; Initialize variables.
  1. N IBAI,IBMDTSPC,POP,STOP
  1. ;
  1. C0 ; Start the Insurance Company Prompts.
  1. K IBMDTSPC,^TMP("IBCMDT",$J),^TMP($J,"IBSEL")
  1. S STOP=0,IBMDTSPC("IBNMSPC")=$J
  1. ;
  1. W @IOF
  1. ;IB*763/CKB - the intro sentence should reference group plans not insurance companies
  1. W !!?5,"This report will generate a list of ACTIVE group plans"
  1. W !?5,"that are missing the data that you select to be reported upon.",!!
  1. ;
  1. ; Select Insurance Companies or All Insurance Companies w/Plans
  1. C10 D SLAI^IBCMDT1 I STOP G:$$STOP EXIT G C0
  1. N IBQUIT S IBQUIT=0
  1. S IBAI=+$G(IBMDTSPC("IBAI"))
  1. D START
  1. I IBQUIT G EXIT
  1. I '$D(^TMP("IBCMDT",$J)) W !!,"No plans selected!" G EXIT
  1. ;
  1. FILTERS ; Begin the Filtering Questions.
  1. ;
  1. N STOP
  1. F0 ; Start of Filters.
  1. S (IBMDTSPC("FLTRS"),STOP)=0
  1. S IBMDTSPC("SUBHD")="Missing Data: "
  1. ; Filter on Missing Group Number
  1. F10 D SLGRN^IBCMDT1
  1. I STOP G:$$STOP EXIT G C0
  1. I +IBMDTSPC("IBGRN") D
  1. . S IBMDTSPC("SUBHD")=IBMDTSPC("SUBHD")_"Group #"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing Type of Plan
  1. F20 D SLPTY^IBCMDT1
  1. I STOP G:$$STOP EXIT G F10
  1. I +IBMDTSPC("IBPTY") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S(+IBMDTSPC("FLTRS"):", ",1:"")_"Plan Type"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing Timely Filing Time Frame
  1. F30 D SLTFT^IBCMDT1
  1. I STOP G:$$STOP EXIT G F20
  1. I +IBMDTSPC("IBTFT") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S(+IBMDTSPC("FLTRS"):", ",1:"")_"FTF"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing Electronic Plan Type
  1. F40 D SLEPT^IBCMDT1
  1. I STOP G:$$STOP EXIT G F30
  1. I +IBMDTSPC("IBEPT") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S(+IBMDTSPC("FLTRS"):", ",1:"")_"Elec Plan"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing Coverage Limitations
  1. F50 D SLCLM^IBCMDT1
  1. I STOP G:$$STOP EXIT G F40
  1. I +IBMDTSPC("IBCLM") S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing BIN (Banking Identification Number)
  1. F60 D SLBIN^IBCMDT1
  1. I STOP G:$$STOP EXIT G F50
  1. I +IBMDTSPC("IBBIN") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S(+IBMDTSPC("FLTRS"):", ",1:"")_"BIN"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. ; Filter on Missing PCN (Processor Control Number)
  1. F70 D SLPCN^IBCMDT1
  1. I STOP G:$$STOP EXIT G F60
  1. I +IBMDTSPC("IBPCN") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S(+IBMDTSPC("FLTRS"):", ",1:"")_"PCN"
  1. . S IBMDTSPC("FLTRS")=IBMDTSPC("FLTRS")+1
  1. ;
  1. I '+IBMDTSPC("FLTRS") D G:$D(DUOUT) EXIT G FILTERS
  1. . W !!,"** No Filters were selected **" ; No Filters were selected so quit.
  1. . D PAUSE^VALM1
  1. I +IBMDTSPC("IBCLM") D
  1. . S IBMDTSPC("SUBHD")=$G(IBMDTSPC("SUBHD"))_$S((+IBMDTSPC("FLTRS")>1):", ",1:"")
  1. . S IBMDTSPC("SUBHD")=IBMDTSPC("SUBHD")_"Coverage Limitations"
  1. ;
  1. F100 D DEVICE(.IBMDTSPC)
  1. I STOP G EXIT ;IB*763/CKB - exit the report if user enters '^'
  1. ;
  1. EXIT ; Exit point
  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. ;
  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) S (STOP,Y)=1 G STOPX
  1. I 'Y S STOP=0
  1. STOPX ; STOP Exit Point
  1. Q Y
  1. ;
  1. START ; Gather the Insurance Companies and respective Plans
  1. I 'IBAI D GTSEL,GTPLNS G STARTQ
  1. D GTALL,GTPLNS
  1. G STARTQ
  1. ;
  1. GTSEL ; Gather plans for all selected companies.
  1. N IBCNS,IBIC
  1. S (IBCT,IBQUIT)=0
  1. K ^TMP("IBCMDT",$J),^TMP($J,"IBSEL")
  1. ;
  1. ; Allow user selection of Insurance Companies, if required
  1. D EN^IBCNILK(1) ; Only want Active Insurance Companies
  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. . ; Insurance Company Name
  1. . S IBIC=$E($$GET1^DIQ(36,IBCNS_",",.01),1,25)
  1. . S ^TMP("IBCMDT",$J,IBIC,IBCNS)=""
  1. K ^TMP("IBCNILKA",$J)
  1. Q
  1. ;
  1. GTALL ; - gather all companies if required
  1. N IBCNS,IBIC1
  1. K ^TMP("IBCMDT",$J),^TMP($J,"IBSEL")
  1. S IBIC1=""
  1. F S IBIC1=$O(^DIC(36,"B",IBIC1)) Q:IBIC1="" D
  1. . S IBCNS=0
  1. . F S IBCNS=$O(^DIC(36,"B",IBIC1,IBCNS)) Q:'IBCNS D
  1. . . I +$$GET1^DIQ(36,IBCNS_",",.05,"I") Q ; Inactive
  1. . . S ^TMP("IBCMDT",$J,$E(IBIC1,1,25),IBCNS)=""
  1. Q
  1. ;
  1. GTPLNS ; - gather plans for selected companies
  1. N IBCNS,IBIC,IBP
  1. S IBIC=""
  1. F S IBIC=$O(^TMP("IBCMDT",$J,IBIC)) Q:IBIC=""!IBQUIT D
  1. . S IBCNS=""
  1. . F S IBCNS=$O(^TMP("IBCMDT",$J,IBIC,IBCNS)) Q:IBCNS=""!(IBQUIT) D
  1. . . S IBP=0
  1. . . F S IBP=$O(^IBA(355.3,"B",+IBCNS,IBP)) Q:'IBP D
  1. . . . S ^TMP("IBCMDT",$J,IBIC,IBCNS,IBP)="" ; Set plans into the array.
  1. Q
  1. ;
  1. STARTQ ;
  1. K IBCNS,IBIC,IBCT,IBP,IBSEL,^TMP($J,"IBSEL")
  1. Q
  1. ;
  1. DEVICE(IBMDTSPC) ; Device Handler and possible TaskManager calls
  1. ; Input: IBMDTSPC - Array passed by reference of the report parameters
  1. ; See top of routine for a detailed explanation
  1. ;
  1. N I,POP,ZTDESC,ZTRTN,ZTSAVE
  1. W *7,!!!?14,"*** WARNING ***"
  1. W !?2,"This report may take a little while to compile!"
  1. W !!?2,"This report is 132 characters wide."
  1. W !?2,"Please choose an appropriate device.",!
  1. S ZTRTN="COMPILE^IBCMDT(.IBMDTSPC)"
  1. S ZTDESC="IB - INSURANCE PLANS MISSING DATA REPORT"
  1. S ZTSAVE("IBMDTSPC(")=""
  1. S ZTSAVE("^TMP(""IBCMDT"",$J,")=""
  1. D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"QM",1)
  1. I POP S STOP=1
  1. DEVICEX ; DEVICE Exit Point
  1. Q
  1. ;
  1. COMPILE(IBMDTSPC) ;
  1. ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
  1. ; Input: IBMDTSPC - Array passed by reference of the report parameters
  1. ; See top of routine for a detailed explanation
  1. ;
  1. N FLTRS,IBAI,IBAPL,IBBIN,IBCLM,IBEPT,IBGRN,IBNMSPC,IBPCN,IBPTY,IBTFT,SUBHD
  1. S FLTRS=$G(IBMDTSPC("FLTRS"))
  1. S IBAI=$G(IBMDTSPC("IBAI"))
  1. S IBAPL=$G(IBMDTSPC("IBAPL"))
  1. S IBGRN=$G(IBMDTSPC("IBGRN"))
  1. S IBPTY=$G(IBMDTSPC("IBPTY"))
  1. S IBTFT=$G(IBMDTSPC("IBTFT"))
  1. S IBEPT=$G(IBMDTSPC("IBEPT"))
  1. S IBCLM=$G(IBMDTSPC("IBCLM"))
  1. S IBBIN=$G(IBMDTSPC("IBBIN"))
  1. S IBNMSPC=$G(IBMDTSPC("IBNMSPC"))
  1. S IBPCN=$G(IBMDTSPC("IBPCN"))
  1. S SUBHD=$G(IBMDTSPC("SUBHD"))
  1. ;
  1. ; Compile
  1. D EN^IBCMDT2
  1. ; Print
  1. D EN^IBCMDT3
  1. ;
  1. COMPILX ; COMPILE Exit Point
  1. Q