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

PRC229.m

Go to the documentation of this file.
  1. PRC229 ;HDSO/JAB - TRANSACTION UTILITY PROGRAM ; 27 FEB 2024
  1. ;;5.1;IFCAP;**229**;;Build 26
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; Reference to ^DIC in ICR #10006
  1. ; Reference to $$FIND1^DIC in ICR #2051
  1. ; Reference to UPDATE^DIE in ICR #2053
  1. ; Reference to $$SITE^VASITE in ICR #10112
  1. ; Reference to $$DT^XLFDT in ICR #10103
  1. ; Reference to $$FMADD^XLFDT in ICR #10103
  1. ; Reference to SENDMSG^XMXAPI in ICR #2729
  1. ; Reference to MES^XPDUTL in ICR #10141
  1. ; Reference to $$PROD^XUPROD in ICR #4440
  1. Q
  1. EN ;Entry point to kill 0 site and 0 FCP entries from FUND CONTROL POINT file 420
  1. ;PRCPRVST - previous site
  1. ;PRCSITE - current site
  1. ;PRCFCP - FCP
  1. ;PRCCNT - Count of 0 nodes deleted
  1. ;PRCBKUP - Backup location of 0 nodes deleted
  1. N PRCPRVST,PRCSITE,PRCFCP,PRCCNT,PRCBKUP
  1. S U="^"
  1. S DT=$$DT^XLFDT
  1. I '$D(^XTMP("PRC229")) S ^XTMP("PRC229",0)=$$FMADD^XLFDT(DT,90)_U_DT
  1. S PRCSITE="" F S PRCSITE=$O(^PRC(420,PRCSITE)) Q:PRCSITE="" D
  1. . ;PRCMSG - Email message
  1. . ;PRCMESS - PRC message
  1. . ;PRCXTMP - ^XTMP message
  1. . ;PRCBDND - PRC bad node
  1. . ;PRCBDMSG - Bad node message
  1. . ;PRCMSGLN - Email message line number
  1. . ;This email info is not static and skips over static portions (PRCMSGLN=5) of email
  1. . N PRCMSG,PRCMESS,PRCXTMP,PRCBDND,PRCBDMSG,PRCMSGLN
  1. . S PRCMSGLN=5,PRCCNT=0,(PRCPRVST,PRCXTMP)=""
  1. . S PRCFCP="" F S PRCFCP=$O(^PRC(420,PRCSITE,1,PRCFCP)) Q:PRCFCP="" D
  1. . . I PRCPRVST'=PRCSITE S PRCCNT=0,PRCPRVST=PRCSITE
  1. . . I PRCSITE=0 D
  1. . . . M ^XTMP("PRC229",DT,PRCSITE,1,PRCFCP)=^PRC(420,PRCSITE,1,PRCFCP)
  1. . . . K ^PRC(420,PRCSITE,1,PRCFCP)
  1. . . . S PRCMSG(PRCMSGLN)=" A SITE that was 0 that had an FCP of "_PRCFCP_"."
  1. . . . S PRCXTMP="backup in ^XTMP(PRC229,"_DT_","_PRCSITE_",1,"_PRCFCP_")."
  1. . . . S PRCBDND=" Deleted ^PRC(420,"_PRCSITE_",1,"_PRCFCP_")"
  1. . . . S PRCMSGLN=PRCMSGLN+1
  1. . . . S PRCCNT=PRCCNT+1
  1. . . . S PRCBDMSG(PRCCNT)=PRCBDND_" "_PRCXTMP
  1. . . I (PRCSITE'=0),(PRCFCP=0),$D(^PRC(420,PRCSITE,1,PRCFCP,4))'=0 D
  1. . . . M ^XTMP("PRC229",DT,PRCSITE,1,PRCFCP,4)=^PRC(420,PRCSITE,1,PRCFCP,4)
  1. . . . K ^PRC(420,PRCSITE,1,PRCFCP,4)
  1. . . . S PRCMSG(PRCMSGLN)=" A FCP that was 0 for SITE "_PRCSITE_"."
  1. . . . S PRCXTMP="backup in ^XTMP(PRC229,"_DT_","_PRCSITE_",1,"_PRCFCP_",4)."
  1. . . . S PRCBDND=" Deleted ^PRC(420,"_PRCSITE_",1,"_PRCFCP_",4)"
  1. . . . S PRCMSGLN=PRCMSGLN+1
  1. . . . S PRCCNT=PRCCNT+1
  1. . . . S PRCBDMSG(PRCCNT)=PRCBDND_" "_PRCXTMP
  1. . . . Q
  1. . . Q
  1. . I (PRCCNT>0) D EMAIL
  1. Q
  1. EMAIL ;
  1. N PRCSUBJ,PRCSTA,PRCENVTP,XMTO,PRCBDCNT
  1. S PRCSUBJ="0 Site and/or FCP Deleted by Nightly Job in "_PRCSITE_"." ;Must < 65 chars
  1. S PRCSUBJ=$TR($E(PRCSUBJ,1,65),U," ")
  1. S PRCSTA=$$SITE^VASITE
  1. S PRCENVTP=$S($$PROD^XUPROD(1):"PRODUCTION",1:"TEST")
  1. S PRCMSG(1)="Good morning,"
  1. S PRCMSG(2)=" "
  1. S PRCMSG(3)="When you receive this email, it indicates inaccessible data with a 0 site and/or 0 FCP was created in past 24 hours."
  1. S PRCMSG(3)=PRCMSG(3)_" The nightly Delete Site/FCP=0 [PRC DELETE SITE/FCP=0] job that runs at 3:00 am found "
  1. S PRCMSG(4)="this data, made a backup of it, and deleted these entries:"
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)=" "
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="Please contact your Budget Analyst team to ask what options they were using involving FCPs in the past 24 hours such"
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="as Carry Forward Quarterly or Release Transaction, or any other activity related to FCP's and if they encountered any"
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="FCP issues."
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)=" "
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="Please submit a Service Now ticket after finding out details from the Budget Analyst team and include these findings"
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="which the IT support team will require to research."
  1. F PRCBDCNT=1:1:PRCCNT S PRCMSGLN=PRCMSGLN+1,PRCMSG(PRCMSGLN)=PRCBDMSG(PRCBDCNT)
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)=" "
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="We are attempting to identify and improve the IFCAP software functionality that causes these 0's to be created."
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)=" "
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)="Thank you."
  1. S PRCMSGLN=PRCMSGLN+1
  1. S PRCMSG(PRCMSGLN)=" "
  1. S PRCMSGLN=PRCMSGLN+1
  1. M PRCMSG=PRCMESS
  1. S XMTO("VHATUCPRC229Distribution@domain.ext")="" ;wrapper email group
  1. D SENDMSG^XMXAPI(DUZ,PRCSUBJ,"PRCMSG",.XMTO)
  1. Q
  1. SCHED229 ;
  1. D MES^XPDUTL("Setting up TASKMAN scheduling.")
  1. N DA,DIC,DIE,DR,DT,FDA,DIIEN,DIMSGA,X,Y,PRCOPIEN,PRCSCIEN,PRCTOM
  1. S DT=$$DT^XLFDT() ;Current Date in FM
  1. S X="PRC DELETE SITE/FCP=0" ;OPTION NAME
  1. S DIC=19
  1. D ^DIC
  1. S FDA(19.2,"?+1,",.01)=+Y ;IEN from DIC 19
  1. S FDA(19.2,"?+1,",2)=DT_".03" ;Install date & daily run time
  1. S FDA(19.2,"?+1,",6)="1D" ;Frequency every 1 day
  1. S FDA(19.2,"?+1,",11)=".5" ; Run as POSTMASTER
  1. D UPDATE^DIE(,"FDA","DIEN","DIMSGA")
  1. S PRCTOM=$$FMADD^XLFDT(DT,1) ;Add 1 day to FM date
  1. S PRCOPIEN=$$FIND1^DIC(19,"","OX","PRC DELETE SITE/FCP=0","B")
  1. S PRCSCIEN=$$FIND1^DIC(19.2,"","B","PRC DELETE SITE/FCP=0","B")
  1. I $P(^DIC(19,PRCOPIEN,0),U,1)="PRC DELETE SITE/FCP=0",PRCSCIEN'="" D
  1. . D MES^XPDUTL("Option 'PRC DELETE SITE/FCP=0' is scheduled to start running on "_PRCTOM_" at 3 am.")
  1. . D MES^XPDUTL("It is "_PRCOPIEN_" in OPTION (#19) file and "_PRCSCIEN_" in OPTION SCHEDULING (#19.2) file.")
  1. Q