RCDPEFA4 ;AITC/CJE - 1ST PARTY AUTO VS MANUAL DECREASE REPORT CONT.;Jun 06, 2014@19:11:19 ; 6/27/19 10:06am
;;4.5;Accounts Receivable;**345,349**;Mar 20, 1995;Build 44
;Per VA Directive 6402, this routine should not be modified.
;
LMOUT(INPUT,RCVAUTD,IO) ; Compile and output report to List Manager
; Input: INPUT - see REPORT for description
; RCVAUTD - Array of selected Divisions
; IO - Device array
; Output: ^TMP("RCDPE_LAR",$J,nn) - Array of display lines (no headers)
N DISP,HDR,HDRINFO,Z0
D REPORT^RCDPEFA3(INPUT,.RCVAUTD,.IO) ; Get lines to be displayed
S DISP=$P(INPUT,"^",2)
D HINFO(INPUT,.HDRINFO)
S HDR("TITLE")="First Party Manual vs Auto"
S HDR(1)=$J("Run Date: ",34)_HDRINFO("RUNDATE")
S Z0="DIVISIONS: "_HDRINFO("DIVISIONS")
S HDR(2)=$S($L(Z0)<75:$J("",75-$L(Z0)\2),1:"")_Z0
S HDR(3)=" Date Range: "_HDRINFO("START")_" - "_HDRINFO("END")_" (Date of Latest Decrease)"
S HDR(4)=$J("",80-$L(HDRINFO("SORT"))\2)_HDRINFO("SORT")
S HDR(5)=" "
I DISP="D" S HDR(6)=" 3rd Party Copay Auto-Decr Man Decr Total Decr Rel"
E S HDR(6)=" Copay Auto-Decr Man Decr Total Decr Rel"
I DISP="D" S HDR(7)="COPAY Bill # Bill# Date Amt Amt Amt Amt Hold"
E S HDR(7)=" Amt Amt Amt Amt Hold"
D LMRPT^RCDPEARL(.HDR,$NA(^TMP("RCDPE_ADP3",$J))) ; Generate ListMan display
K ^TMP("RCDPEFADP3",$J),^TMP($J,"RCDPEFADP3"),^TMP("RCDPE_ADP3",$J)
Q
;
HINFO(INPUTS,HDRINFO) ; Get header information
; Input: INPUTS - See REPORT for description
; HDRINFO - Header array for ListMan, passed by ref.
N XX
S XX=$P(INPUTS,U,4) ; Auto-Post Date range
S HDRINFO("START")=$$FMTE^XLFDT($P(XX,"|",1),"2SZ")
S HDRINFO("END")=$$FMTE^XLFDT($P(XX,"|",2),"2SZ")
S HDRINFO("RUNDATE")=$$FMTE^XLFDT($$NOW^XLFDT,"2SZ")
S XX=$P(INPUTS,U,2) ; Sort Type
S HDRINFO("SORT")="Sorted By: Claim - "_$S($P(INPUTS,U,3)="L":"Last to First",1:"First to Last")
S HDRINFO("SORT")=HDRINFO("SORT")_" Display: "_$S($P(INPUTS,U,2)="S":"Summary",1:"Detail")
;
; Format Division filter
S XX=$P(INPUTS,U,1) ; 1 - All Divisions, 2- selected
S HDRINFO("DIVISIONS")=$S(XX=2:$$LINE^RCDPEFA3(.RCVAUTD),1:"ALL")
Q
;
BULL(TYPE) ; Produce bulletin for weekly summary report
; Input: TYPE = W - Weekly, M - Monthly
; Output: MailMan bulletin with one week summary report all divisions
N DT,GLB,HDR,HDRINFO,INPUTS,J,LCNT,RCNT,X,XMDUZ,XMTEXT,XMSUB,XMY,XMINSTR,Y,Z0
S GLB=$NA(^TMP("RCDPEFA4",$J,"XMTEXT"))
K @GLB
S INPUTS="1^S^F^" ; All divisions^SUMMARY^Sort Claims First to Last
S DT=$$DT^XLFDT()
I TYPE="W" S INPUTS=INPUTS_$$FMADD^XLFDT(DT,-7)_"|"_DT_"^" ; Date Range last 7 days
I TYPE="M" D ; Date Range previous Month
. S X=$E(DT,1,5)_"01"
. S Y=$$FMADD^XLFDT(X,-1)
. S INPUTS=INPUTS_$E(Y,1,5)_"01"_"|"_Y_"^"
S INPUTS=INPUTS_"1" ; Use ListMan format to get data in arrays
;
K ^TMP("RCDPEFADP3",$J),^TMP("RCDPE_ADP3",$J) ; Clear ^TMP global
D REPORT^RCDPEFA3(INPUTS,.RCVAUTD,.IO)
D HINFO(INPUTS,.HDRINFO)
S HDR("TITLE")="First Party Manual vs Auto"
S RCNT=1
S @GLB@(RCNT)=$J("",80-$L(HDR("TITLE"))\2)_HDR("TITLE")
S RCNT=RCNT+1
S Z0="Run Date: "_HDRINFO("RUNDATE")
S @GLB@(RCNT)=$J("",80-$L(Z0)\2)_Z0
S RCNT=RCNT+1
S @GLB@(RCNT)=" Date Range: "_HDRINFO("START")_" - "_HDRINFO("END")_" (Date of Latest Decrease)"
S RCNT=RCNT+1
S @GLB@(RCNT)=$J("",80-$L(HDRINFO("SORT"))\2)_HDRINFO("SORT")
S RCNT=RCNT+1
S @GLB@(RCNT)=" "
S RCNT=RCNT+1
S @GLB@(RCNT)=" Copay Auto-Decr Man Decr Total Decr"
S RCNT=RCNT+1
S @GLB@(RCNT)=" Amt Amt Amt Amt RH"
S RCNT=RCNT+1
S Z0="" F J=1:1:79 S Z0=Z0_"-"
S @GLB@(RCNT)=Z0
S RCNT=RCNT+1
;
S LCNT=0
F S LCNT=$O(^TMP("RCDPE_ADP3",$J,LCNT)) Q:'LCNT D ;
. S @GLB@(RCNT)=$E(^TMP("RCDPE_ADP3",$J,LCNT),2,80)
. S RCNT=RCNT+1
;
;Transmit mail message
S XMDUZ=DUZ,XMTEXT=GLB
S XMSUB=HDR("TITLE")
S XMY("I:G.FIRST PARTY COPAY DECREASE")=""
S XMINSTR("FROM")="POSTMASTER"
D SENDMSG^XMXAPI(XMDUZ,XMSUB,XMTEXT,.XMY,.XMINSTR)
;
K @GLB
K ^TMP("RCDPEFADP3",$J),^TMP("RCDPE_ADP3",$J) ; Clear ^TMP global
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCDPEFA4 4507 printed Nov 22, 2024@16:54:51 Page 2
RCDPEFA4 ;AITC/CJE - 1ST PARTY AUTO VS MANUAL DECREASE REPORT CONT.;Jun 06, 2014@19:11:19 ; 6/27/19 10:06am
+1 ;;4.5;Accounts Receivable;**345,349**;Mar 20, 1995;Build 44
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
LMOUT(INPUT,RCVAUTD,IO) ; Compile and output report to List Manager
+1 ; Input: INPUT - see REPORT for description
+2 ; RCVAUTD - Array of selected Divisions
+3 ; IO - Device array
+4 ; Output: ^TMP("RCDPE_LAR",$J,nn) - Array of display lines (no headers)
+5 NEW DISP,HDR,HDRINFO,Z0
+6 ; Get lines to be displayed
DO REPORT^RCDPEFA3(INPUT,.RCVAUTD,.IO)
+7 SET DISP=$PIECE(INPUT,"^",2)
+8 DO HINFO(INPUT,.HDRINFO)
+9 SET HDR("TITLE")="First Party Manual vs Auto"
+10 SET HDR(1)=$JUSTIFY("Run Date: ",34)_HDRINFO("RUNDATE")
+11 SET Z0="DIVISIONS: "_HDRINFO("DIVISIONS")
+12 SET HDR(2)=$SELECT($LENGTH(Z0)<75:$JUSTIFY("",75-$LENGTH(Z0)\2),1:"")_Z0
+13 SET HDR(3)=" Date Range: "_HDRINFO("START")_" - "_HDRINFO("END")_" (Date of Latest Decrease)"
+14 SET HDR(4)=$JUSTIFY("",80-$LENGTH(HDRINFO("SORT"))\2)_HDRINFO("SORT")
+15 SET HDR(5)=" "
+16 IF DISP="D"
SET HDR(6)=" 3rd Party Copay Auto-Decr Man Decr Total Decr Rel"
+17 IF '$TEST
SET HDR(6)=" Copay Auto-Decr Man Decr Total Decr Rel"
+18 IF DISP="D"
SET HDR(7)="COPAY Bill # Bill# Date Amt Amt Amt Amt Hold"
+19 IF '$TEST
SET HDR(7)=" Amt Amt Amt Amt Hold"
+20 ; Generate ListMan display
DO LMRPT^RCDPEARL(.HDR,$NAME(^TMP("RCDPE_ADP3",$JOB)))
+21 KILL ^TMP("RCDPEFADP3",$JOB),^TMP($JOB,"RCDPEFADP3"),^TMP("RCDPE_ADP3",$JOB)
+22 QUIT
+23 ;
HINFO(INPUTS,HDRINFO) ; Get header information
+1 ; Input: INPUTS - See REPORT for description
+2 ; HDRINFO - Header array for ListMan, passed by ref.
+3 NEW XX
+4 ; Auto-Post Date range
SET XX=$PIECE(INPUTS,U,4)
+5 SET HDRINFO("START")=$$FMTE^XLFDT($PIECE(XX,"|",1),"2SZ")
+6 SET HDRINFO("END")=$$FMTE^XLFDT($PIECE(XX,"|",2),"2SZ")
+7 SET HDRINFO("RUNDATE")=$$FMTE^XLFDT($$NOW^XLFDT,"2SZ")
+8 ; Sort Type
SET XX=$PIECE(INPUTS,U,2)
+9 SET HDRINFO("SORT")="Sorted By: Claim - "_$SELECT($PIECE(INPUTS,U,3)="L":"Last to First",1:"First to Last")
+10 SET HDRINFO("SORT")=HDRINFO("SORT")_" Display: "_$SELECT($PIECE(INPUTS,U,2)="S":"Summary",1:"Detail")
+11 ;
+12 ; Format Division filter
+13 ; 1 - All Divisions, 2- selected
SET XX=$PIECE(INPUTS,U,1)
+14 SET HDRINFO("DIVISIONS")=$SELECT(XX=2:$$LINE^RCDPEFA3(.RCVAUTD),1:"ALL")
+15 QUIT
+16 ;
BULL(TYPE) ; Produce bulletin for weekly summary report
+1 ; Input: TYPE = W - Weekly, M - Monthly
+2 ; Output: MailMan bulletin with one week summary report all divisions
+3 NEW DT,GLB,HDR,HDRINFO,INPUTS,J,LCNT,RCNT,X,XMDUZ,XMTEXT,XMSUB,XMY,XMINSTR,Y,Z0
+4 SET GLB=$NAME(^TMP("RCDPEFA4",$JOB,"XMTEXT"))
+5 KILL @GLB
+6 ; All divisions^SUMMARY^Sort Claims First to Last
SET INPUTS="1^S^F^"
+7 SET DT=$$DT^XLFDT()
+8 ; Date Range last 7 days
IF TYPE="W"
SET INPUTS=INPUTS_$$FMADD^XLFDT(DT,-7)_"|"_DT_"^"
+9 ; Date Range previous Month
IF TYPE="M"
Begin DoDot:1
+10 SET X=$EXTRACT(DT,1,5)_"01"
+11 SET Y=$$FMADD^XLFDT(X,-1)
+12 SET INPUTS=INPUTS_$EXTRACT(Y,1,5)_"01"_"|"_Y_"^"
End DoDot:1
+13 ; Use ListMan format to get data in arrays
SET INPUTS=INPUTS_"1"
+14 ;
+15 ; Clear ^TMP global
KILL ^TMP("RCDPEFADP3",$JOB),^TMP("RCDPE_ADP3",$JOB)
+16 DO REPORT^RCDPEFA3(INPUTS,.RCVAUTD,.IO)
+17 DO HINFO(INPUTS,.HDRINFO)
+18 SET HDR("TITLE")="First Party Manual vs Auto"
+19 SET RCNT=1
+20 SET @GLB@(RCNT)=$JUSTIFY("",80-$LENGTH(HDR("TITLE"))\2)_HDR("TITLE")
+21 SET RCNT=RCNT+1
+22 SET Z0="Run Date: "_HDRINFO("RUNDATE")
+23 SET @GLB@(RCNT)=$JUSTIFY("",80-$LENGTH(Z0)\2)_Z0
+24 SET RCNT=RCNT+1
+25 SET @GLB@(RCNT)=" Date Range: "_HDRINFO("START")_" - "_HDRINFO("END")_" (Date of Latest Decrease)"
+26 SET RCNT=RCNT+1
+27 SET @GLB@(RCNT)=$JUSTIFY("",80-$LENGTH(HDRINFO("SORT"))\2)_HDRINFO("SORT")
+28 SET RCNT=RCNT+1
+29 SET @GLB@(RCNT)=" "
+30 SET RCNT=RCNT+1
+31 SET @GLB@(RCNT)=" Copay Auto-Decr Man Decr Total Decr"
+32 SET RCNT=RCNT+1
+33 SET @GLB@(RCNT)=" Amt Amt Amt Amt RH"
+34 SET RCNT=RCNT+1
+35 SET Z0=""
FOR J=1:1:79
SET Z0=Z0_"-"
+36 SET @GLB@(RCNT)=Z0
+37 SET RCNT=RCNT+1
+38 ;
+39 SET LCNT=0
+40 ;
FOR
SET LCNT=$ORDER(^TMP("RCDPE_ADP3",$JOB,LCNT))
if 'LCNT
QUIT
Begin DoDot:1
+41 SET @GLB@(RCNT)=$EXTRACT(^TMP("RCDPE_ADP3",$JOB,LCNT),2,80)
+42 SET RCNT=RCNT+1
End DoDot:1
+43 ;
+44 ;Transmit mail message
+45 SET XMDUZ=DUZ
SET XMTEXT=GLB
+46 SET XMSUB=HDR("TITLE")
+47 SET XMY("I:G.FIRST PARTY COPAY DECREASE")=""
+48 SET XMINSTR("FROM")="POSTMASTER"
+49 DO SENDMSG^XMXAPI(XMDUZ,XMSUB,XMTEXT,.XMY,.XMINSTR)
+50 ;
+51 KILL @GLB
+52 ; Clear ^TMP global
KILL ^TMP("RCDPEFADP3",$JOB),^TMP("RCDPE_ADP3",$JOB)
+53 QUIT