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

RCP321.m

Go to the documentation of this file.
RCP321 ;BIRM/EWL ALB/PJH - ePayment Lockbox Post-Installation Processing ;Dec 20, 2014@14:08:45
 ;;4.5;Accounts Receivable;**321**;Jan 21, 2014;Build 48
 ;Per VA Directive 6402, this routine should not be modified.
 Q
 ;
POST() ; Task jobs to initialize RCDPE COMMENT HISTORY file #344.73
 ;
 N DIK,ERR,K34461,RCENT,RCERR,RCINST,RCOUT,RCPAR,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
 ; set ^XTMP zero node for 180 day retention
 S ^XTMP($T(+0),0)=$$HTFM^XLFDT($H+180)_U_DT_"^PRCA*4.5*321 post-installation"
 D BMES^XPDUTL("Post-installation tasks "_$$FMTE^XLFDT($$NOW^XLFDT)) ; add date/time to log
 D BMES^XPDUTL("Queueing task to initialize RCDPE COMMENT HISTORY file #344.73")
 S ZTRTN="INIT1^"_$T(+0),ZTDESC="RCDPE COMMENT HISTORY (#344.73) post-init work",ZTIO="",ZTDTH=$H
 D ^%ZTLOAD
 D MES^XPDUTL($S($G(ZTSK):"Task number "_ZTSK_" has been queued.",1:"Unable to queue this task."))
 I $G(ZTSK) D MES^XPDUTL("A MailMan message will be sent on completion.")
 ;
 D BMES^XPDUTL("Deleting old style 'B' index on file (#344.6)")
 D DELIX^DDMOD(344.6,.01,1,"K")
 D BMES^XPDUTL("Re-indexing PAYER NAME on AUTO-PAY EXCLUSION file (#344.6)")
 S DIK="^RCY(344.6,",DIK(1)=".01^B" D ENALL^DIK
 D BMES^XPDUTL("Re-indexing DATE OPENED on AR BATCH PAYMENTS file (#344)")
 S DIK="^RCY(344,",DIK(1)=".03^AO" D ENALL^DIK
 ;
 ; RCDPE AUDIT mail group update 
 N RCAUD,RCRMEM,Z
 D MES^XPDUTL("Updating RCDPE AUDIT mail group.")
 ; Integration Agreement 6814 for access to ^XMB(3.8
 S RCAUD=$$FIND1^DIC(3.8,"","MX","RCDPE AUDIT","","","ERR") Q:'RCAUD
 ; Delete any REMOTE MEMBER containing text of VHA835NOTIFY (upper or lower case)
 S Z=0
 F  S Z=$O(^XMB(3.8,RCAUD,6,Z)) Q:'Z  D
 . S RCRMEM=$$GET1^DIQ(3.812,Z_","_RCAUD_",",.01)
 . Q:$$UP^XLFSTR(RCRMEM)'["VHA835NOTIFY"
 . N DA,DIK
 . S DA(1)=RCAUD,DA=Z,DIK="^XMB(3.8,"_DA(1)_",6,"
 . D ^DIK
 . D MES^XPDUTL("Removed REMOTE MEMBER = "_RCRMEM)
 ;
 ; If empty populate parameter DAY TO SEND WORKLOAD NOTIFICATIONS with SATURDAY
 D:$$GET1^DIQ(344.61,"1,",.1)=""
 .N DA,DIE,DR
 .S DIE="^RCY(344.61,",DR=".1///SA;",DA=1 D ^DIE
 ;
 ; Decrease Medical and Pharmacy EFT prevent days if they exceed the new maximum
 S K34461=0
 F  S K34461=$O(^RCY(344.61,K34461)) Q:'K34461  D
 . N MEPREV,RXPREV
 . S MEPREV=$$GET1^DIQ(344.61,K34461_",",.06,"I")
 . I MEPREV>60 D  ;
 . . N FDA
 . . S FDA(344.61,K34461_",",.06)=60
 . . D FILE^DIE("","FDA")
 . ;
 . S RXPREV=$$GET1^DIQ(344.61,K34461_",",.07,"I")
 . I RXPREV>365 D  ;
 . . N FDA
 . . S FDA(344.61,K34461_",",.07)=365
 . . D FILE^DIE("","FDA")
 ;
US795 ; Convert default for ERA_CLAIM_TYPE in worklist from "B" to "A"
 K ^TMP($J,"RCP321")
 S RCOUT="^TMP($J,""RCP321"")"
 S RCPAR="RCDPE EDI LOCKBOX WORKLIST"
 S RCINST="ERA_CLAIM_TYPE"
 D ENVAL^XPAR(.RCOUT,RCPAR,RCINST,.RCERR,1) ; IA 2992 PARAMETER DEFINITION TOOLKIT
 S RCENT=""
 F  S RCENT=$O(^TMP($J,"RCP321",RCENT)) Q:RCENT=""  D  ;
 . I $G(^TMP($J,"RCP321",RCENT,RCINST))="B" D  ;
 . . D EN^XPAR(RCENT,RCPAR,RCINST,"A",.RCERR) ; IA 2992 PARAMETER DEFINITION TOOLKIT
 ;
 Q
 ;
INIT1 ;Build 344.73
 ; Clear any existing history
 D PURGE
 ;
 N COMMENT,DATE,RCNODE,RCBODY,RCSUBJ,RCTO,RCLINE,RCRCPT,RCSUSP,RCZR,USER,XMINSTR
 S RCNODE("BEG")=$$NOW^XLFDT,RCNODE("CNT")=0
 S ^XTMP($T(+0),"BEGIN")=RCNODE("BEG")
 ;Scan receipt file for suspense comments
 S RCRCPT=0
 F  S RCRCPT=$O(^RCY(344,RCRCPT)) Q:'RCRCPT  D
 . S RCLINE=0
 . F  S RCLINE=$O(^RCY(344,RCRCPT,1,RCLINE)) Q:'RCLINE  D
 .. ; Check that line is still in suspense
 .. S RCSUSP=$$GET1^DIQ(344.01,RCLINE_","_RCRCPT_",",3.01) Q:RCSUSP=""
 .. ; Receipt line comment
 .. S COMMENT=$$GET1^DIQ(344.01,RCLINE_","_RCRCPT_",",1.02) Q:$L(COMMENT)<3
 .. ; Date placed into suspense
 .. S DATE=$$GET1^DIQ(344.01,RCLINE_","_RCRCPT_",",3.02,"I") Q:DATE=""
 .. ; Placed into suspense by
 .. S USER=$$GET1^DIQ(344.01,RCLINE_","_RCRCPT_",",3.03,"I") Q:USER=""
 .. N FDA,ERR
 .. S FDA(344.73,"+1,",.01)=RCRCPT ;Receipt
 .. S FDA(344.73,"+1,",1)=RCLINE  ;Scratchpad or Receipt Line Number
 .. S FDA(344.73,"+1,",2)=USER              ;User
 .. S FDA(344.73,"+1,",3)=DATE              ;Date/time ;
 .. S FDA(344.73,"+1,",4)=COMMENT           ;Comment ;file entry
 .. D UPDATE^DIE(,"FDA","ERR")
 .. S RCNODE("CNT")=RCNODE("CNT")+1
 ;
 S RCNODE("END")=$$NOW^XLFDT
 S ^XTMP($T(+0),"FINISHED")=RCNODE("END")
 ; create MailMan message text
 S RCBODY(0)=0
 D ADD2TXT(.RCBODY,"Finished RCDPE COMMENT HISTORY file #344.73 initialization task.")
 D ADD2TXT(.RCBODY," Process begun: "_$$FMTE^XLFDT(RCNODE("BEG")))
 D ADD2TXT(.RCBODY," Process ended: "_$$FMTE^XLFDT(RCNODE("END")))
 D ADD2TXT(.RCBODY," Comment count: "_$$FMTE^XLFDT(RCNODE("CNT")))
 D ADD2TXT(.RCBODY,"Report generated by the "_$T(+0)_" post-initialization routine.")
 ;
 ; save MailMan message text
 M ^XTMP($T(+0),"MAIL MSG",$$NOW^XLFDT)=RCBODY
 ; send via MailMan
 S RCSUBJ="PRCA*4.5*321 Post Install Routine Completed"
 S RCTO(.5)="",RCTO(DUZ)=""  ; POSTMASTER and user who queued it
 S RCTO("G.RCDPE PAYMENTS MGMT")=""
 S XMINSTR("FROM")="POSTMASTER"
 ;
 D SENDMSG^XMXAPI(DUZ,RCSUBJ,"RCBODY",.RCTO,.XMINSTR,.RCZR) ; send message
 Q
 ;
ADD2TXT(TXARY,LN) ; add LN to TXARY for MailMan Message
 ; TXARY passed by ref.
 I $G(LN)'="" S TXARY(0)=$G(TXARY(0))+1,TXARY(TXARY(0),0)=LN
 Q
 ;
PURGE ; Clear any existing history
 N DA,DIK,RCPURGE,SUB
 S SUB=0
 F  S SUB=$O(^RCY(344.73,SUB)) Q:'SUB  D
 .S DIK="^RCY(344.73,",DA=SUB D ^DIK
 K ^XTMP($T(+0))
 Q