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

IBCNRRP1.m

Go to the documentation of this file.
  1. IBCNRRP1 ;BHAM ISC/CMW - Group Plan Worksheet Report ;03-MAR-2004
  1. ;;2.0;INTEGRATED BILLING;**251,276**;21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ; e-Pharmacy Group Plan Worksheet Report
  1. ;
  1. ; Input parameter: N/A
  1. ; Other relevant variables:
  1. ; IBCNRRTN = "IBCNRRP1" (current routine name for queuing the
  1. ; COMPILE process)
  1. ; IBCNRSPC("BEGDT") = start date for date range
  1. ; IBCNRSPC("ENDDT") = end date for date range
  1. ; IBCNRSPC("SORT") = 1 - By Insurance/Group; 2 - Total Claims;
  1. ; 3 - Total Charges; 4 - BIN/PCN Exceptions
  1. ; IBCNRSPC("MATCH")= 1 - Matched only; 0 - All
  1. ;
  1. ; Enter only from EN tag ONLY
  1. Q
  1. ;
  1. ; Entry point
  1. EN ;
  1. ; Initialize variables
  1. N STOP,IBCNRRTN,IBCNRSPC,RESORT
  1. D:'$D(IOF) HOME^%ZIS
  1. ;
  1. S STOP=0,IBPXT=$G(IBPXT)
  1. S IBCNRRTN="IBCNRRP1"
  1. W @IOF
  1. W !,"ePHARM GROUP PLAN WORKSHEET REPORT",!
  1. W !,"NCPDP process requires that the users match Group Plans to Pharmacy Plans."
  1. W !,"This report will assist users in matching Group Insurance Plans to Pharmacy"
  1. W !," Plans by searching through Billing/Claims file for authorized claims that "
  1. W !," have Group Plans with active Pharmacy Plan coverage."
  1. ;
  1. ; Prompts
  1. ; lock global
  1. L +^XTMP(IBCNRRTN):5 I '$T W !!,"Sorry, Worksheet Report in use." H 2 G EXIT
  1. ;Check for prior compile
  1. P10 D RESORT(.RESORT) I STOP G EXIT
  1. I $G(RESORT) G P40
  1. K ^XTMP(IBCNRRTN)
  1. ; Date Range parameters
  1. P30 D DTRANGE I STOP G:$$STOP EXIT G P10
  1. ; Sort parameters
  1. P40 D SORT I STOP G:$$STOP EXIT G P30
  1. ; Select the output device
  1. P100 D DEVICE(IBCNRRTN,.IBCNRSPC) I STOP!IBPXT G:$$STOP EXIT G P40
  1. ;
  1. EXIT ; Quit this routine
  1. ; unlock global
  1. L -^XTMP(IBCNRRTN)
  1. K IBPXT
  1. Q
  1. ;
  1. RESORT(RESORT) ; check for prior compile
  1. NEW DIR,BDT,EDT,RDT,HDR,IBDT,X,Y,DIRUT
  1. I '$D(^XTMP(IBCNRRTN)) Q
  1. S IBDT=$G(^XTMP(IBCNRRTN,0,0))
  1. S BDT=$P(IBDT,U,1),EDT=$P(IBDT,U,2),RDT=$P(IBDT,U,3),RESORT=0
  1. S HDR=$$FMTE^XLFDT(BDT,"5Z")_" - "_$$FMTE^XLFDT(EDT,"5Z")
  1. W !!,"A Report file run on: ",RDT,!,?5," exist for date range: ",HDR,!
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to use the existing report file"
  1. S DIR("B")="YES"
  1. S DIR("?",1)=" Enter YES to use the existing report file."
  1. S DIR("?")=" Enter NO to DELETE existing file and recompile,"
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G RESRTX
  1. S RESORT=Y
  1. S IBCNRSPC("RESORT")=Y
  1. S IBCNRSPC("BEGDT")=BDT
  1. S IBCNRSPC("ENDDT")=EDT
  1. ;
  1. RESRTX ;RESORT EXIT
  1. Q
  1. ;
  1. COMPILE(IBCNRRTN,IBCNRSPC) ;
  1. ; Entry point called from EN^XUTMDEVQ in either direct or queued mode.
  1. ; Input params:
  1. ; IBCNRRTN = Routine name for ^TMP(...
  1. ; IBCNRSPC = Array passed by ref of the report params
  1. ;
  1. ; Init scratch globals
  1. I '$G(IBCNRSPC("RESORT")) D
  1. . ; Compile
  1. . I IBCNRRTN="IBCNRRP1" D EN^IBCNRRP2(IBCNRRTN,.IBCNRSPC)
  1. ; Print
  1. I '$G(ZTSTOP) D
  1. . I IBCNRRTN="IBCNRRP1" D EN^IBCNRRP3(IBCNRRTN,.IBCNRSPC)
  1. ; Close device
  1. D ^%ZISC
  1. ;
  1. ; Purge task record
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. ;
  1. COMPILX ; COMPILE exit pt
  1. Q
  1. ;
  1. STOP() ; Determine if user wants to exit out of the whole option
  1. ; Init vars
  1. N DIR,X,Y,DIRUT
  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. ;
  1. STOPX ; STOP exit pt
  1. Q Y
  1. ;
  1. DTRANGE ; Determine start and end dates for date range param
  1. ; Init vars
  1. N X,Y,DIRUT
  1. ;
  1. W !
  1. ;
  1. S DIR(0)="D^::EX"
  1. S DIR("A")="Start DATE"
  1. S DIR("?",1)=" Please enter a valid date for which an Bill/Claim"
  1. S DIR("?")=" would have been authorized."
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G DTRANGX
  1. S IBCNRSPC("BEGDT")=Y
  1. ; End date
  1. DTRANG1 S DIR(0)="D^::EX"
  1. S DIR("A")=" End DATE"
  1. S DIR("?",1)=" Please enter a valid date for which an Bill/Claim"
  1. S DIR("?",2)=" would have been authorized. This date must not precede"
  1. S DIR("?")=" the Start Date."
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G DTRANGX
  1. I Y<IBCNRSPC("BEGDT") D G DTRANG1
  1. . W !," End Date must not precede the Start Date."
  1. . W !," Please reenter."
  1. S IBCNRSPC("ENDDT")=Y
  1. ;
  1. DTRANGX ; DTRANGE exit pt
  1. Q
  1. ;
  1. SORT ; Prompt to allow users to sort the report
  1. ; by Insurance/Group, Max claims, Max charges
  1. NEW DIR,X,Y,DIRUT
  1. ;
  1. S DIR(0)="S^1:Insurance/Group;2:Total Claims;3:Total Charges;4:Exceptions Only"
  1. S DIR("A")=" Select the primary sort field"
  1. S DIR("B")=1
  1. S DIR("?",1)=" 1 - Sort all Claims by Insurance/Group. (Default)"
  1. S DIR("?",2)=" 2 - Sort by Groups with the most Claims"
  1. S DIR("?",3)=" 3 - Sort by Groups with the most Charges"
  1. S DIR("?",4)=" 4 - Show BIN/PCN Exceptions only"
  1. D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G SORTX
  1. S IBCNRSPC("SORT")=Y
  1. ;
  1. ;Prompt for All/Matched only
  1. S DIR(0)="SA^A:All;M:Matched Only"
  1. S DIR("A")=" List (A)LL Insurance/Groups or (M)atched Only: "
  1. S DIR("B")="Matched Only"
  1. W ! D ^DIR K DIR
  1. I $D(DIRUT) S STOP=1 G SORTX
  1. S IBCNRSPC("MATCH")=(Y="M")
  1. ;
  1. SORTX ; SORT exit point
  1. Q
  1. ;
  1. ;
  1. DEVICE(IBCNRRTN,IBCNRSPC) ; Device Handler and possible TaskManager calls
  1. ;
  1. ; Input params:
  1. ; IBCNRRTN = Routine name for ^TMP($J,...
  1. ; IBCNRSPC = Array passed by ref of the report params
  1. ;
  1. ; Init vars
  1. N ZTRTN,ZTDESC,ZTSAVE,POP
  1. ;
  1. ;I IBCNRRTN="IBCNRRP1" W !!!,"*** This report is 132 characters wide ***",!
  1. S ZTRTN="COMPILE^IBCNRRP1("""_IBCNRRTN_""",.IBCNRSPC)"
  1. S ZTDESC="ePHARM GROUP PLAN WORKSHEET REPORT"
  1. S ZTSAVE("IBCNRSPC(")=""
  1. S ZTSAVE("IBCNRRTN")=""
  1. D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
  1. I POP S STOP=1
  1. ;
  1. DEVICEX ; DEVICE exit pt
  1. Q
  1. ;