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

DVB4P66.m

Go to the documentation of this file.
  1. DVB4P66 ;ALB/MJB/RC - DISABILITY FILE UPDATE ; 11/16/10 3:50pm
  1. ;;4.0;HINQ;**66**;03/25/92;Build 14
  1. ;
  1. Q
  1. EN ; Post Install entry point (from build).
  1. ; Set Up Kernel Checkpoints.
  1. N DVBCKPT,DVBCKPTIEN
  1. F DVBCKPT="POST" D
  1. .S DVBCKPTIEN=$$NEWCP^XPDUTL(DVBCKPT,DVBCKPT_"^DVB4P66")
  1. .I 'DVBCKPTIEN D
  1. ..D BMES^XPDUTL("ERROR Creating "_DVBCKPT_" Checkpoint.")
  1. ..D BMES^XPDUTL("Please verify that this post-install routine runs to completion.")
  1. Q
  1. POST ; Post install entry point (manual).
  1. N DVBPID,DVBTMP,DVBTMPRT
  1. S DVBPID="DVB*4.0*66",DVBTMPRT="^TMPRT(""DVB4P66"",$J)"
  1. K @DVBTMPRT
  1. S @DVBTMPRT=DT_U_"DVB*4.0*66 Post Install"
  1. D DELICD,ADDICD
  1. ;DVB*4.0*66 - ADDCOND, no disability conditions were added.
  1. K @DVBTMPRT
  1. Q
  1. ADDCOND ;Add Disability Conditions to DISABILITY CONDITION (#31) file.
  1. D BMES^XPDUTL(" Adding disability conditions to the DISABILITY CONDITION (#31) file. ")
  1. N DVBTOT,DVBTMP
  1. S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"ADDCOND"))
  1. K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add disability conditions."_U_$$NOW^XLFDT
  1. D POST^DVB4P66A(DVBTMP,.DVBTOT)
  1. S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
  1. D ERROR(DVBTMP,"add conditions")
  1. Q
  1. DELICD ;Inactivate ICD codes associated with DISABILITY CONDITION (#31) file.
  1. D BMES^XPDUTL(" Inactivating codes ICD codes from the DISABILITY CONDITION (#31) file. ")
  1. N DVBTOT,DVBTMP
  1. S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"DELICD"))
  1. K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, inactivate ICD codes."_U_$$NOW^XLFDT
  1. D POST^DVB4P66I(DVBTMP,.DVBTOT)
  1. S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
  1. D ERROR(DVBTMP,"delete")
  1. Q
  1. ADDICD ;Add ICD codes to DISABILITY CONDITION (#31) file.
  1. D BMES^XPDUTL(" Adding ICD codes to the DISABILITY CONDITION (#31) file. ")
  1. N DVBTOT,DVBTMP
  1. S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"ADDICD"))
  1. K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add ICD codes."_U_$$NOW^XLFDT
  1. D POST^DVB4P66A(DVBTMP,.DVBTOT)
  1. S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
  1. D ERROR(DVBTMP,"add")
  1. Q
  1. ERROR(DVBTMP,DVBPHASE) ;Error Handling/Notification
  1. ;DVBTMP - Global Root containing error.
  1. ;DVBPHASE - Phase of installation.
  1. I '$D(@DVBTMP@("ERROR")) D Q
  1. .D BMES^XPDUTL(" >>> *** SUCCESS updating the DISABILITY CONDITION (#31) file.")
  1. .D MES^XPDUTL(" Total RELATED ICD9 CODES "_DVBPHASE_"ed: "_DVBTOT)
  1. .;
  1. D BMES^XPDUTL(" >>> *** FAILURE updating the DISABILITY CONDITION (#31) file.")
  1. D BMES^XPDUTL(" Filing errors have occurred when updating the file.")
  1. D MES^XPDUTL(" 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 errors.")
  1. D BMES^XPDUTL(" Once these errors 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^DVB4P66")
  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*66 Patch Post-Install Error Listing"
  1. S XMTEXT="DVBMSG("
  1. S XMY(DUZ)="",XMDUZ=.5
  1. ;S XMDUZ=.5,(XMY(DUZ),XMY(XMDUZ))=""
  1. S DVBMSG(1)="Patch: DVB*4.0*66 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. Errors have occurred when"
  1. S DVBMSG(5)="attempting to make the changes."
  1. S DVBMSG(6)=""
  1. S DVBMSG(7)="Resolution of ALL errors is needed to maintain database integrity."
  1. S DVBMSG(8)=""
  1. S DVBMSG(9)="Once these filing errors 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^DVB4P66"
  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 errors:"
  1. S DVBMSG(18)=""
  1. S DVBMSG(19)="*** DISABILITY CONDITION FILE (#31) FILING ERRORS ***"
  1. S DVBMSG(20)="-----------------------------------------------------"
  1. ;
  1. ;loop and list errors
  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. ;