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

DVB458P.m

Go to the documentation of this file.
  1. DVB458P ;ALB/RBS - ENV/PRE/POST-INSTALL FOR PATCH DVB*4*58 ; 1/11/07 1:34pm
  1. ;;4.0;HINQ;**58**;03/25/92;Build 29
  1. ;
  1. ;This routine is the main install routine that will update the
  1. ;DISABILITY CONDITION (#31) file with the new mapping of Rated
  1. ;Disabilities (VA) VBA DX CODES to specific ICD DIAGNOSIS codes.
  1. ;There are 3,085 ICD9 codes that will be added to the (#31) file.
  1. ;
  1. ;
  1. Q ;no direct entry
  1. ;
  1. ;
  1. ENV ;Main entry point for Environment check point.
  1. ;
  1. S XPDABORT=""
  1. ;checks programmer variables
  1. D PROGCHK(.XPDABORT)
  1. ;check if patch install is running
  1. D ISRUNING(.XPDABORT)
  1. ;
  1. I XPDABORT="" K XPDABORT
  1. Q
  1. ;
  1. ;
  1. PRE ;Main entry point for Pre-init items.
  1. ;
  1. Q
  1. ;
  1. ;
  1. POST ;Main entry point for Post-init items.
  1. ;
  1. N DVBTOT ;count of total ICD9 codes filed
  1. N DVBTMP ;Closed Root global reference for error reporting
  1. ;remove data from #field 20 in file #31 and repopulate
  1. I $$VFIELD^DILFD(31,20) D
  1. .D DELETE^DVB458P1
  1. S DVBTMP=$NA(^TMP("DVB458P",$J))
  1. K @DVBTMP
  1. S @DVBTMP@(0)="PATCH DVB*4*58 POST-INSTALL^"_$$NOW^XLFDT
  1. S DVBTOT=0
  1. ;
  1. D BMES^XPDUTL(" >>> *** Updating the DISABILITY CONDITION (#31) file...")
  1. D MES^XPDUTL(" *** Please be patient, this should take less than 5 minutes.")
  1. D MES^XPDUTL(" ")
  1. ;
  1. ;call to process (#31) file updates
  1. D POST^DVB458P1(DVBTMP,.DVBTOT)
  1. ;
  1. S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
  1. ;
  1. I '$D(@DVBTMP@("ERROR")) D
  1. . D BMES^XPDUTL(" >>> *** SUCCESS updating the DISABILITY CONDITION (#31) file.")
  1. . D MES^XPDUTL(" Total RELATED ICD9 CODES filed: "_DVBTOT)
  1. . ;
  1. E D
  1. . D BMES^XPDUTL(" >>> *** FAILURE updating the DISABILITY CONDITION (#31) file.")
  1. . D BMES^XPDUTL(" Filing error's have occurred when adding the new RELATED ICD9 CODES.")
  1. . D MES^XPDUTL(" Immediate resolution is necessary to maintain database integrity.")
  1. . D BMES^XPDUTL(" A MailMan message has been sent to the installer of this patch")
  1. . D MES^XPDUTL(" with a listing of the error's.")
  1. . D BMES^XPDUTL(" Once these filing error's have been resolved, please re-run")
  1. . D MES^XPDUTL(" the Post-Installation routine directly from programmer mode")
  1. . D MES^XPDUTL(" by entering the following command:")
  1. . D MES^XPDUTL(" ")
  1. . D MES^XPDUTL(" D POST^DVB458P")
  1. . D MES^XPDUTL(" ")
  1. . D BMES^XPDUTL(" >>> I'm now creating and sending the MailMan message...")
  1. . ;
  1. . D SENDMSG(DVBTMP,.DVBTOT)
  1. . ;
  1. . D MES^XPDUTL(" >>> All done.")
  1. ;
  1. ;cleanup temp file
  1. K @DVBTMP
  1. Q
  1. ;
  1. ;
  1. SENDMSG(DVBTMP,DVBTOT) ;send failure MailMan message to installer of patch
  1. ;
  1. N DIFROM,DVBMSG
  1. N XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
  1. S XMSUB="DVB*4.0*58 Patch Post-Install Error Listing"
  1. S XMTEXT="DVBMSG("
  1. S XMDUZ=.5,(XMY(DUZ),XMY(XMDUZ))=""
  1. S DVBMSG(1)="Patch: DVB*4.0*58 Automated Service Connected Designation"
  1. S DVBMSG(2)=""
  1. S DVBMSG(3)="The post-installation update of the DISABILITY CONDITION (#31) file"
  1. S DVBMSG(4)="has FAILED to successfully complete. Filing error's have occurred when"
  1. S DVBMSG(5)="attempting to add the new data mapping of RELATED ICD9 CODES."
  1. S DVBMSG(6)=""
  1. S DVBMSG(7)="Immediate resolution of ALL error's is needed to maintain database integrity."
  1. S DVBMSG(8)=""
  1. S DVBMSG(9)="Once these filing error's have been resolved, please re-run"
  1. S DVBMSG(10)="the Post-Installation routine directly from programmer mode"
  1. S DVBMSG(11)="by entering the following command:"
  1. S DVBMSG(12)=""
  1. S DVBMSG(13)="D POST^DVB458P"
  1. S DVBMSG(14)=""
  1. S DVBMSG(15)="The new update run time should take less than 5 minutes to complete."
  1. S DVBMSG(16)=""
  1. S DVBMSG(17)=">>> Please review and resolve the following error's:"
  1. S DVBMSG(18)=""
  1. S DVBMSG(19)="*** DISABILITY CONDITION FILE (#31) FILING ERRORS ***"
  1. S DVBMSG(20)="-----------------------------------------------------"
  1. ;
  1. ;loop and list error's
  1. N DVBICD,DVBHDR,DVBHDR1,DVBIEN,DVBLN,DVBMSS,DVBVBA,DVBDESC
  1. S DVBHDR="VBA DX CODE: ",DVBHDR1=" ICD DIAGNOSIS CODE: "
  1. S DVBLN=21,DVBVBA=0
  1. F S DVBVBA=$O(@DVBTMP@("ERROR",DVBVBA)) Q:'DVBVBA D
  1. . I $D(@DVBTMP@("ERROR",DVBVBA,0)) D Q
  1. . . S DVBMSS=DVBHDR_DVBVBA_" - "_$G(@DVBTMP@("ERROR",DVBVBA,0))
  1. . . S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
  1. . K DVBDESC D FIND^DIC(31,"","","X",DVBVBA,,"C","","","DVBDESC")
  1. . S DVBMSS=DVBHDR_DVBVBA_" - "_$E($G(DVBDESC("DILIST",1,1)),1,50)
  1. . S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
  1. . S DVBIEN=0
  1. . F S DVBIEN=$O(@DVBTMP@("ERROR",DVBVBA,DVBIEN)) Q:'DVBIEN D
  1. . . S DVBICD=""
  1. . . F S DVBICD=$O(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD)) Q:DVBICD="" D
  1. . . . S DVBMSS=DVBHDR1_DVBICD_" - "_$G(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD))
  1. . . . S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
  1. S DVBMSG(DVBLN)="",DVBLN=DVBLN+1
  1. S DVBMSG(DVBLN)="<End of Report>"
  1. ;
  1. D ^XMD
  1. Q
  1. ;
  1. ;
  1. PROGCHK(XPDABORT) ;checks for necessary programmer variables
  1. ;
  1. I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
  1. . D BMES^XPDUTL("*****")
  1. . D MES^XPDUTL("Your programming variables are not set up properly.")
  1. . D MES^XPDUTL("Installation aborted.")
  1. . D MES^XPDUTL("*****")
  1. . S XPDABORT=2
  1. Q
  1. ;
  1. ;
  1. ISRUNING(XPDABORT) ;check if patch install is running
  1. ;
  1. I $D(^TMP("DVB458P")) D
  1. . D BMES^XPDUTL("*****")
  1. . D MES^XPDUTL("This patch is currently being Installed. Try later.")
  1. . D MES^XPDUTL("Installation aborted.")
  1. . D MES^XPDUTL("*****")
  1. . S XPDABORT=2
  1. Q