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

RCDPEWL5.m

Go to the documentation of this file.
  1. RCDPEWL5 ;ALB/TMK/PJH - ELECTRONIC EOB WORKLIST ACTIONS ; 7/30/10 6:52pm
  1. ;;4.5;Accounts Receivable;**173,208,269**;Mar 20, 1995;Build 113
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. INIT ; Build receipt preview
  1. N X,Z,Z1,Z10,Z0,Z2,RCZ
  1. K ^TMP("RCDPE_EOB_PREVIEW",$J)
  1. S VALMCNT=0,VALMBG=1
  1. S Z=0 F S Z=$O(^RCY(344.49,RCSCR,1,Z)) Q:'Z S Z0=$G(^(Z,0)) D
  1. . I $P(Z0,U)\1=+Z0 S Z2=$P(Z0,U,2)
  1. . I $P($P(Z0,U),".",2) D
  1. .. S:$P(Z0,U,2)="" $P(Z0,U,2)=Z2
  1. .. S RCZ=$S(+$P(Z0,U,6)=0:0,+$P(Z0,U,6)<0:-1,$P(Z0,U,7):1,1:2)
  1. .. S RCZ(RCZ,Z)=Z0
  1. .. S Z1=0 F S Z1=$O(^RCY(344.49,RCSCR,1,Z,1,Z1)) Q:'Z1 S Z10=$G(^(Z1,0)) D
  1. ... I $P(Z10,U,5)=1 S RCZ(RCZ,Z,"ADJ",Z1)="Dec adj $"_$J(0-$P(Z10,U,3),"",2)_" pending - ",RCZ(RCZ,Z,"ADJ",Z1,1)=$J("",4)_$P(Z10,U,9)
  1. F RCZ=1,2,0,-1 D
  1. . Q:'$D(RCZ(RCZ))
  1. . I RCZ=1 D SET("PAYMENTS (LINES FOR RECEIPT):")
  1. . I RCZ=0,VALMCNT>0 D SET(" ") D SET("ZERO DOLLAR PAYMENTS:")
  1. . I RCZ=-1,VALMCNT>0 D SET(" ") D SET("LINES WITH NEGATIVE BALANCES STILL NEEDING TO BE DISTRIBUTED:")
  1. . S Z=0 F S Z=$O(RCZ(RCZ,Z)) Q:'Z S Z0=RCZ(RCZ,Z) D
  1. .. S X=""
  1. .. S X=$$SETFLD^VALM1($P(Z0,U),X,"LINE #")
  1. .. S X=$$SETFLD^VALM1($S($P(Z0,U,7):$$BN1^PRCAFN($P(Z0,U,7)),1:$S(RCZ=0:"",1:"[SUSPENSE]")_$S($P(Z0,U,2)["**ADJ"&'$P($P(Z0,U,2),"ADJ",2):"TOTALS MISMATCH ADJ",1:$P(Z0,U,2))),X,"ACCOUNT")
  1. .. S X=$$SETFLD^VALM1($J(+$P(Z0,U,6),"",2),X,"AMOUNT")
  1. .. D SET(X)
  1. .. S Z1=0 F S Z1=$O(RCZ(RCZ,Z,"ADJ",Z1)) Q:'Z1 D SET($J("",12)_$G(RCZ(RCZ,Z,"ADJ",Z1))) S Z2=0 F S Z2=$O(RCZ(RCZ,Z,"ADJ",Z1,Z2)) Q:'Z2 D SET($J("",12)_$G(RCZ(RCZ,Z,"ADJ",Z1,Z2)))
  1. Q
  1. ;
  1. SET(X) ;
  1. S VALMCNT=VALMCNT+1
  1. S ^TMP("RCDPE_EOB_PREVIEW",$J,VALMCNT,0)=X
  1. Q
  1. ;
  1. HDR ;
  1. D HDR^RCDPEWL
  1. Q
  1. ;
  1. FNL ;
  1. K ^TMP("RCDPE_EOB_PREVIEW",$J)
  1. Q
  1. ;
  1. RCOMM ; Allow entry of receipt comment to be moved to line on receipt
  1. N RCEDIT
  1. D FULL^VALM1
  1. ;
  1. I $G(RCSCR("NOEDIT"))=2 D NOTAV^RCDPEWL2 G RCOMMQ
  1. ;
  1. D SEL^RCDPEWL2(.RCEDIT)
  1. G:'RCEDIT RCOMMQ
  1. ;
  1. RCOMMQ S VALMBCK="R"
  1. Q
  1. ;
  1. SUSPERA ; Option entrypoint to select an ERA to be posted to suspense
  1. N DIC,X,Y,RCERA,RCSCR,DTOUT,DUOUT,DIR
  1. S DIC(0)="AEMQ",DIC="^RCY(344.4,",DIC("S")="I '$P(^(0),U,8),'$G(^(20))"
  1. D ^DIC K DIC
  1. I Y'>0 Q
  1. S RCERA=+Y
  1. S DIR(0)="YA",DIR("B")="YES",DIR("A")="DO YOU WANT TO PRINT/VIEW THE ERA FIRST?: " W ! D ^DIR K DIR
  1. Q:$D(DUOUT)!$D(DTOUT)
  1. I Y=1 S RCSCR=RCERA D PRERA^RCDPEWL0
  1. D SUSP(RCERA,0)
  1. Q
  1. ;
  1. SUSP(RCERA,LM) ; Function to send receipt to suspense for ERA
  1. ; RCERA = ien of entry in file 344.4
  1. ; LM = flag to indicate it was called from list manager protocol
  1. ; = 1 if true, 0 if false
  1. N DIR,X,Y,RC0,RCCOM,RCER,RCPAYTY,RECTDA,RCTRANDA,DIE,DA,DR,Z,DTOUT,DUOUT,RC5
  1. S RC0=$G(^RCY(344.4,RCERA,0)),RC5=$G(^RCY(344.4,RCERA,5))
  1. I $G(LM) D FULL^VALM1
  1. I $$HACERA^RCDPEU(RCERA) D G SUSPQ
  1. . S DIR(0)="EA",DIR("A")="THIS IS NOT A VALID ACTION FOR AN ERA FROM HAC" W ! D ^DIR K DIR
  1. S DIR(0)="YA",DIR("B")="NO"
  1. I $P(RC0,U,5) D
  1. . S DIR("A",1)="THIS WILL CREATE A RECEIPT THAT WILL MOVE THE FUNDS ($"_$J($P(RC0,U,5),"",2)_")",DIR("A",2)="FOR THIS ENTIRE ERA TO YOUR SUSPENSE ACCOUNT",Z=3
  1. E D
  1. . S DIR("A",1)="THIS WILL CREATE AND POST A RECEIPT FOR $0.00 FOR THIS ERA",Z=2
  1. S DIR("A",Z+1)=" ",DIR("A",Z+2)="***ALL POSTINGS TO A/R FOR ANY CLAIMS IN THIS ERA MUST BE DONE MANUALLY***",DIR("A",Z+3)=" "
  1. S DIR("A")="ARE YOU SURE YOU WANT TO CONTINUE?: "
  1. W ! D ^DIR K DIR
  1. I Y'=1 D NOACT G SUSPQ
  1. S DIR("A",1)="ENTER A 1-60 CHARACTER COMMENT TO BE PLACED ON THE RECEIPT: ",DIR("A")=">: ",DIR(0)="FA^1:60",DIR("B")="REF ERA #:"_RCERA_" FROM "_$E($P(RC0,U,6),1,20) W ! D ^DIR K DIR
  1. I $D(DTOUT)!$D(DUOUT) D NOACT G SUSPQ
  1. S RCCOM=Y
  1. S RCPAYTY=$S($P(RC5,U,2)="":14,1:4)
  1. S RECTDA=$$BLDRCPT^RCDPUREC(DT,"",+$O(^RC(341.1,"AC",+RCPAYTY,0)))
  1. I 'RECTDA D G SUSPQ
  1. . S DIR(0)="EA",DIR("A",1)="A PROBLEM WAS ENCOUNTERED ADDING THE RECEIPT",DIR("A")="NO ACTION TAKEN - RETURN TO CONTINUE: " W ! D ^DIR K DIR
  1. ;
  1. S RCTRANDA=$$ADDTRAN^RCDPURET(RECTDA)
  1. S DR=".04////"_(+$P(RC0,U,5))_$S($P(RC5,U,2)'="":";.13////"_$P(RC5,U,2),1:"")_$S(RCCOM'="":";1.02////"_RCCOM,1:"")
  1. S DA(1)=RECTDA,DA=RCTRANDA,DIE="^RCY(344,"_DA(1)_",1,"
  1. D ^DIE
  1. ;
  1. I $D(^RCY(344.49,RCERA,0)) S DIE="^RCY(344.49,",DA=RCERA,DR=".02////"_RECTDA D ^DIE
  1. S DIE="^RCY(344.4,",DA=RCERA,DR=".08////"_RECTDA_";20.01///^S X=""NOW"";20.02////"_DUZ D ^DIE
  1. S Z=+$O(^RCY(344.31,"AERA",RCERA,0))
  1. S DIE="^RCY(344,",DA=RECTDA,DR=".18////"_RCERA_$S(Z:";.17////"_Z,1:"") D ^DIE
  1. ;
  1. D PROCESS^RCDPURE1(RECTDA,1)
  1. I '$P(RC0,U,5) S DIE="^RCY(344.4,",DA=RCERA,DR=".09////3;.14////1" D ^DIE
  1. S DIR(0)="E" W ! D ^DIR K DIR
  1. ;
  1. SUSPQ I $G(LM) S VALMBCK="R"
  1. Q
  1. ;
  1. REVIEW ; Enter review information on worklist and turn review display on/off
  1. ; Assumes RCSCR = ien of the entry in file 344.49
  1. ;
  1. N Z,RC,RCDA,RCZ,DIC,DA,DIE,DR,X,Y,DIR,REVCHG,RCUSPREF,RCLSTREV,RCREV
  1. D FULL^VALM1
  1. ;
  1. S REVCHG=""
  1. S DIR(0)="YA",RC=+$P($G(^TMP($J,"RC_SORTPARM")),U,2)
  1. S DIR("A",1)="REVIEW DATA DISPLAY IS CURRENTLY TURNED "_$P("OFF^ON",U,RC+1),DIR("A")="DO YOU WANT TO TURN IT "_$P("ON^OFF",U,RC+1)_"?: ",DIR("B")=$S('RC:"YES",1:"NO") W ! D ^DIR K DIR
  1. I Y=1 S $P(^TMP($J,"RC_SORTPARM"),U,2)=((RC+1)#2),REVCHG=1
  1. S RCUSPREF=+$O(^RCY(344.49,RCSCR,2,"B",DUZ,0))
  1. ;
  1. I 'RCUSPREF D ; Add the user pref record
  1. . S RCUSPREF=+$$ADDUSER(RCSCR,DUZ)
  1. S RCLSTREV=+$P($G(^RCY(344.49,RCSCR,2,RCUSPREF,0)),U,2)
  1. S DA(1)=RCSCR,DA=RCUSPREF
  1. I DA,RCLSTREV'=$P($G(^TMP($J,"RC_SORTPARM")),U,2) D ; Update user pref
  1. . S DIE="^RCY(344.49,"_DA(1)_",2,",DR=".02////"_+$P($G(^TMP($J,"RC_SORTPARM")),U,2) D ^DIE
  1. W !
  1. I '$P(^TMP($J,"RC_SORTPARM"),U,2) G REVIEWQ
  1. ;
  1. D SEL^RCDPEWL(.RCDA)
  1. S RCZ=+$O(RCDA(0)),RCZ=+$G(RCDA(RCZ)) G:'RCZ REVIEWQ
  1. ;
  1. S RCREV=0
  1. I '$O(^RCY(344.49,RCSCR,1,"AC",DUZ,RCZ,0)) D
  1. . S RCREV=$$NEWREV(RCSCR,RCZ,DUZ)
  1. E D
  1. . N DIR,X,Y
  1. . S DIR("A")="(A)DD or (E)DIT A REVIEW COMMENT?: ",DIR("B")="ADD",DIR(0)="SA^A:ADD;E:EDIT" W ! D ^DIR K DIR
  1. . I $D(DUOUT)!$D(DTOUT) Q
  1. . ;
  1. . I Y="E" D Q ; Edit a review entry entered by same user
  1. .. N DA,DR,DIE,X,Y
  1. .. S DA(1)=RCSCR,DA=RCZ,DIC="^RCY(344.49,"_DA(1)_",1,"_DA_",4,",DIC(0)="AEMQ",DIC("S")="I $P(^(0),U,2)=DUZ" D ^DIC
  1. .. S RCREV=$S(Y>0:+Y,1:0)
  1. .. I RCREV S DA(2)=RCSCR,DA(1)=RCZ,DA=RCREV,DIE="^RCY(344.49,"_DA(2)_",1,"_DA(1)_",4,",DR=".03;.04////^S X=$$NOW^XLFDT()" D ^DIE
  1. . ;
  1. . S RCREV=$$NEWREV(RCSCR,RCZ,DUZ)
  1. ;
  1. I RCREV S DIE("NO^")="",DA(1)=RCSCR,DA=RCZ,DIE="^RCY(344.49,"_DA(1)_",1,",DR=".11R;I X=0 S Y=""@10"";.12////^S X=DUZ;S Y=""@20"";@10;.12///@;@20" D ^DIE K DIE
  1. D BLD^RCDPEWL1($G(^TMP($J,"RC_SORTPARM")))
  1. S REVCHG=""
  1. ;
  1. REVIEWQ I $G(REVCHG) D BLD^RCDPEWL1($G(^TMP($J,"RC_SORTPARM")))
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. NEWREV(RCSCR,RCZ,RCDUZ) ; Enter a new review comment
  1. ; RCSCR = ien of entry in file 344.49
  1. ; RCZ = ien of the EEOB (seq #)
  1. ; RCDUZ =DUZ of user entering the comment
  1. ; Function returns 0 if no new comment, ien of comment if added
  1. N DA,X,Y,DIC,DIK,DLAYGO,DO,DD,RCREV,RCNOW
  1. S RCNOW=$$NOW^XLFDT() W !!,"REVIEW DATE/TIME: "_$$FMTE^XLFDT(RCNOW,"2")
  1. S DA(2)=RCSCR,DA(1)=RCZ,X=RCNOW,DIC("DR")=".02////"_RCDUZ_";.03",DLAYGO=344.492,DIC(0)="L"
  1. S DIC="^RCY(344.49,"_DA(2)_",1,"_DA(1)_",4,"
  1. K DO,DD
  1. D FILE^DICN K DO,DD,DIC,DLAYGO
  1. S RCREV=+Y
  1. I RCREV'>0 S RCREV=0 G NEWREVQ
  1. I '$O(^RCY(344.49,DA(2),1,DA(1),4,RCREV,0)) S DIK="^RCY(344.49,"_DA(2)_",1,"_DA(1)_",4,",DA=RCREV D ^DIK S RCREV=0 ; No comment - delete entry
  1. ;
  1. NEWREVQ Q RCREV
  1. ;
  1. NOACT ;
  1. N DIR,X,Y
  1. S DIR(0)="EA",DIR("A")="NO ACTION TAKEN - RETURN TO CONTINUE: " W ! D ^DIR K DIR
  1. Q
  1. ;
  1. ADDUSER(RCSCR,RCDUZ) ; Add user record to user preferences multiple in file 344.49 and initialize all preferences
  1. ; RCSCR = ien of entry in file 344.49
  1. ; RCDUZ = the ien of the user
  1. N DIC,DA,X,Y,DLAYGO,DO,DD
  1. S Y=+$O(^RCY(344.49,RCSCR,2,"B",RCDUZ,0))
  1. I Y G ADDUQ
  1. S DLAYGO=344.492,DA(1)=RCSCR,DIC(0)="L",X=RCDUZ,DIC="^RCY(344.49,"_DA(1)_",2,",DIC("DR")=".02////0;.03////N"
  1. D FILE^DICN K DIC,DLAYGO
  1. ADDUQ Q $S(Y>0:Y,1:0)
  1. ;