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

BPSNTR01.m

Go to the documentation of this file.
  1. BPSNTR01 ; AITC/MRD - NTR-Related Reports; JAN 09, 2020@08:23
  1. ;;1.0;E CLAIMS MGMT ENGINE;**27**;JUN 2004;Build 15
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q
  1. ;
  1. EN ;
  1. ;
  1. N BPSCNT,BPSDATE,BPSDATESUB,BPSIEN57
  1. N BPSQUIT,BPSTOUCH,BPSTYPE,BPSYRMO,DIR,DIRUT
  1. ;
  1. ; Display a brief description of the report.
  1. ;
  1. W !!,"This report will display a line for each transaction"
  1. W !,"in the month* specified. The earliest month possible is"
  1. W !,"January, 2004."
  1. W !," Note: The transactions will be displayed according to"
  1. W !," the date last updated, not the date submitted."
  1. W !
  1. ;
  1. ; Prompt user for desired month and year.
  1. ;
  1. DATE ;
  1. S DIR(0)="FAO^4:7^K:X'?1.2N1""/""1.2N X"
  1. S DIR("A")="Enter a month and year (M/YY or MM/YY): "
  1. S DIR("?")="Example values: 1/18, 01/18, 12/19."
  1. D ^DIR
  1. I $G(DIRUT) G QUIT
  1. S BPSYRMO=$P(X,"/",1)
  1. I BPSYRMO>12 W !,"Please try again",*7,! G DATE
  1. I $L(BPSYRMO)<2 S BPSYRMO="0"_BPSYRMO
  1. S BPSYRMO=3_$P(X,"/",2)_BPSYRMO
  1. I BPSYRMO<30401 W !,"Please try again",*7,! G DATE
  1. I $O(^BPSTL("AH",(BPSYRMO_"00")))="" W !,"Please try again",*7,! G DATE
  1. ;
  1. W !
  1. D HEADER
  1. ;
  1. S BPSQUIT=0
  1. S BPSCNT=0
  1. ;
  1. ; Initialize the looping variable to be the 0th day of the month
  1. ; selected by the user.
  1. ;
  1. S BPSDATE=BPSYRMO_"00"
  1. F S BPSDATE=$O(^BPSTL("AH",BPSDATE)) Q:'BPSDATE Q:$E(BPSDATE,1,5)>BPSYRMO D Q:BPSQUIT
  1. . S BPSIEN57=0
  1. . F S BPSIEN57=$O(^BPSTL("AH",BPSDATE,BPSIEN57)) Q:'BPSIEN57 D Q:BPSQUIT
  1. . . ;
  1. . . ; Skip if non-billable; skip if the Submit Date is earlier than
  1. . . ; the first day of the selected month.
  1. . . ;
  1. . . I $$GET1^DIQ(9002313.57,BPSIEN57,19,"I")="N" Q
  1. . . I $$GET1^DIQ(9002313.57,BPSIEN57,6,"I")<(BPSYRMO_"01") Q
  1. . . ;
  1. . . W !,$$GET1^DIQ(9002313.57,BPSIEN57,1.11,"E") ; Rx#
  1. . . W "/",$$GET1^DIQ(9002313.57,BPSIEN57,9,"E") ; Fill#
  1. . . ;
  1. . . W ?11,$$FMTE^XLFDT(BPSDATE,"2D") ; Date Last Update
  1. . . S BPSDATESUB=$$GET1^DIQ(9002313.57,BPSIEN57,6,"I")
  1. . . W ?20,$$FMTE^XLFDT(BPSDATESUB,"2D") ; Submit Date
  1. . . ;
  1. . . W ?29,$$GET1^DIQ(9002313.57,BPSIEN57,1201) ; RX Action (BWHERE)
  1. . . ;
  1. . . S BPSTOUCH=$$TOUCHED^BPSUTIL(BPSIEN57)
  1. . . W ?34,$S(BPSTOUCH:"Manual",1:"No-Touch") ; Touched?
  1. . . ;
  1. . . S BPSTYPE=$$TYPE(BPSIEN57)
  1. . . W ?43,$E(BPSTYPE,1,10) ; Transaction Type
  1. . . ;
  1. . . W ?54,$E($$GET1^DIQ(9002313.57,BPSIEN57,5,"E"),1,15) ; Patient Name
  1. . . ;
  1. . . W ?71,BPSIEN57 ; Transaction IEN
  1. . . ;
  1. . . S BPSCNT=BPSCNT+1
  1. . . I BPSCNT#22=0 D
  1. . . . N DIR,DIRUT
  1. . . . S DIR(0)="E"
  1. . . . D ^DIR
  1. . . . I $G(DIRUT) S BPSQUIT=1 Q
  1. . . . D HEADER
  1. . . . Q
  1. . . Q
  1. . Q
  1. ;
  1. W !
  1. G DATE
  1. ;
  1. QUIT ;
  1. ;
  1. Q
  1. ;
  1. ;
  1. W !,"Rx#/Fill",?10,"Last Updt",?20,"SubmitDt",?29,"Actn",?34,"Touched?"
  1. W ?44,"Type",?54,"Patient",?64,"Transaction IEN"
  1. ;
  1. Q
  1. ;
  1. TALLY ;
  1. ;
  1. N BPSDATE,BPSENDDATE,BPSIEN57,BPSSTARTDATE,BPSSUBMIT,BPSTOTALS
  1. N BPSYRMO,DIR,DIRUT,X,Y
  1. ;
  1. S BPSTOTALS=""
  1. ;
  1. ; Prompt user for desired year.
  1. ;
  1. W !!,"This report will display counts of transactions for"
  1. W !,"each month in fiscal year specified, with sub-totals"
  1. W !,"by transaction type and by no-touch vs manual."
  1. W !
  1. S DIR(0)="NAO^2008:2036"
  1. S DIR("A")="Enter a year: "
  1. D ^DIR
  1. I $G(DIRUT) Q
  1. ;
  1. ; Determine the range of months to be included. Since we wish to
  1. ; display a year's worth according to fiscal year, the starting
  1. ; month will be October of the previous year, and the ending month
  1. ; will be September of the year selected.
  1. ;
  1. S Y=Y-1700
  1. S BPSSTARTDATE=(Y-1)_10
  1. S BPSENDDATE=Y_"09"
  1. ;
  1. ; Loop through all transactions from the start date to today. All
  1. ; transactions with a Submit Date in the fiscal year selected by
  1. ; the user will be counted.
  1. ;
  1. S BPSDATE=BPSSTARTDATE_"00"
  1. F S BPSDATE=$O(^BPSTL("AH",BPSDATE)) Q:'BPSDATE D
  1. . ;
  1. . S BPSIEN57=0
  1. . F S BPSIEN57=$O(^BPSTL("AH",BPSDATE,BPSIEN57)) Q:'BPSIEN57 D
  1. . . ;
  1. . . ; Skip if non-billable.
  1. . . ;
  1. . . I $$GET1^DIQ(9002313.57,BPSIEN57,19,"I")="N" Q
  1. . . ;
  1. . . ; Skip if Submit Date is not in the selected fiscal year.
  1. . . ;
  1. . . S BPSSUBMIT=$$GET1^DIQ(9002313.57,BPSIEN57,6,"I")
  1. . . S BPSSUBMIT=$E(BPSSUBMIT,1,5)
  1. . . I BPSSUBMIT<BPSSTARTDATE Q
  1. . . I BPSSUBMIT>BPSENDDATE Q
  1. . . ;
  1. . . ; Add this transaction to the totals.
  1. . . ;
  1. . . D COUNT(BPSIEN57,BPSSUBMIT,.BPSTOTALS)
  1. . . ;
  1. . . Q
  1. . Q
  1. ;
  1. F BPSYRMO=BPSSTARTDATE:1:BPSENDDATE D
  1. . I $E(BPSYRMO,4,5)=13 S BPSYRMO=($E(BPSYRMO,1,3)+1)_"01"
  1. . ;
  1. . ; Write the results for this month.
  1. . ;
  1. . D DISPLAY(BPSYRMO,.BPSTOTALS)
  1. . ;
  1. . Q
  1. ;
  1. W !
  1. N DIR
  1. S DIR(0)="E"
  1. D ^DIR
  1. ;
  1. Q
  1. ;
  1. COUNT(BPSIEN57,BPSSUBMIT,BPSTOTALS) ; Add one transaction to the totals.
  1. ;
  1. ; For the given transactions, this procedure will determine a count of the
  1. ; number of transactions of each type (payable, rejected, duplicate,
  1. ; captured, accepted, reversal, eligibility, completed) and manual
  1. ; vs no-touch.
  1. ;
  1. ; Input:
  1. ; BPSIEN57 is a pointer to 9002313.57, BPS LOG OF TRANSACTIONS.
  1. ; BPSSUBMIT is a year+month portion of the Submit Date for the
  1. ; transaction passed in (e.g. 31912 = December 2019).
  1. ; Output:
  1. ; BPSTOTALS is passed by reference. The format returned is:
  1. ; BPSTOTALS(YearMonth) = total transactions for that month
  1. ; BPSTOTALS(YearMonth,1,Type) = count for a given type
  1. ; BPSTOTALS(YearMonth,1,Type,Touched) = count of
  1. ; transactions with a given type + manual/no-touch
  1. ; BPSTOTALS(YearMonth,2,Touched) = count for manual/no-touch
  1. ;
  1. N BPSTOUCHED,BPSTYPE
  1. ;
  1. S BPSTYPE=$$TYPE(BPSIEN57)
  1. ;
  1. S BPSTOUCHED=$$TOUCHED^BPSUTIL(BPSIEN57)
  1. I BPSTOUCHED=1 S BPSTOUCHED="Manual"
  1. E S BPSTOUCHED="No-Touch"
  1. ;
  1. S BPSTOTALS(BPSSUBMIT)=$G(BPSTOTALS(BPSSUBMIT))+1
  1. S BPSTOTALS(BPSSUBMIT,1,BPSTYPE)=$G(BPSTOTALS(BPSSUBMIT,1,BPSTYPE))+1
  1. S BPSTOTALS(BPSSUBMIT,1,BPSTYPE,BPSTOUCHED)=$G(BPSTOTALS(BPSSUBMIT,1,BPSTYPE,BPSTOUCHED))+1
  1. S BPSTOTALS(BPSSUBMIT,2,BPSTOUCHED)=$G(BPSTOTALS(BPSSUBMIT,2,BPSTOUCHED))+1
  1. ;
  1. Q
  1. ;
  1. DISPLAY(BPSYRMO,BPSTOTALS) ; Write the results for one month.
  1. ;
  1. W !!,$E(BPSYRMO,1,3)+1700,"/",$E(BPSYRMO,4,5)
  1. W ?11,"Payable",?20,"Rejected",?30,"Duplicate",?41,"Captured",?51,"Reversal",?61,"Unstranded",?73,"Total"
  1. ;
  1. W !," Manual"
  1. W ?11,$J(+$G(BPSTOTALS(BPSYRMO,1,"Payable","Manual")),7)
  1. W ?20,$J(+$G(BPSTOTALS(BPSYRMO,1,"Rejected","Manual")),8)
  1. W ?30,$J(+$G(BPSTOTALS(BPSYRMO,1,"Duplicate","Manual")),9)
  1. W ?41,$J(+$G(BPSTOTALS(BPSYRMO,1,"Captured","Manual")),8)
  1. W ?51,$J(+$G(BPSTOTALS(BPSYRMO,1,"Reversal","Manual")),8)
  1. W ?61,$J(+$G(BPSTOTALS(BPSYRMO,1,"Unstranded","Manual")),10)
  1. W ?73,$J(+$G(BPSTOTALS(BPSYRMO,2,"Manual")),5)
  1. ;
  1. W !,"No-Touch"
  1. W ?11,$J(+$G(BPSTOTALS(BPSYRMO,1,"Payable","No-Touch")),7)
  1. W ?20,$J(+$G(BPSTOTALS(BPSYRMO,1,"Rejected","No-Touch")),8)
  1. W ?30,$J(+$G(BPSTOTALS(BPSYRMO,1,"Duplicate","No-Touch")),9)
  1. W ?41,$J(+$G(BPSTOTALS(BPSYRMO,1,"Captured","No-Touch")),8)
  1. W ?51,$J(+$G(BPSTOTALS(BPSYRMO,1,"Reversal","No-Touch")),8)
  1. W ?61,$J(+$G(BPSTOTALS(BPSYRMO,1,"Unstranded","No-Touch")),10)
  1. W ?73,$J(+$G(BPSTOTALS(BPSYRMO,2,"No-Touch")),5)
  1. ;
  1. W !," Totals"
  1. W ?11,$J(+$G(BPSTOTALS(BPSYRMO,1,"Payable")),7)
  1. W ?20,$J(+$G(BPSTOTALS(BPSYRMO,1,"Rejected")),8)
  1. W ?30,$J(+$G(BPSTOTALS(BPSYRMO,1,"Duplicate")),9)
  1. W ?41,$J(+$G(BPSTOTALS(BPSYRMO,1,"Captured")),8)
  1. W ?51,$J(+$G(BPSTOTALS(BPSYRMO,1,"Reversal")),8)
  1. W ?61,$J(+$G(BPSTOTALS(BPSYRMO,1,"Unstranded")),10)
  1. W ?73,$J(+$G(BPSTOTALS(BPSYRMO)),5)
  1. ;
  1. Q
  1. ;
  1. TYPE(BPSIEN57) ; Determine the type of this transaction.
  1. ;
  1. N BPSSTATUS
  1. ;
  1. S BPSSTATUS=$$GET1^DIQ(9002313.57,BPSIEN57,4.0098)
  1. ;
  1. I BPSSTATUS="E CAPTURED" Q "Captured"
  1. I BPSSTATUS="E DUPLICATE" Q "Duplicate"
  1. I BPSSTATUS="E PAYABLE" Q "Payable"
  1. I BPSSTATUS="E REJECTED" Q "Rejected"
  1. I BPSSTATUS["REVERSAL" Q "Reversal"
  1. I BPSSTATUS="E UNSTRANDED" Q "Unstranded"
  1. ;
  1. Q "Other"
  1. ;