DVB4P66 ;ALB/MJB/RC - DISABILITY FILE UPDATE ; 11/16/10 3:50pm
;;4.0;HINQ;**66**;03/25/92;Build 14
;
Q
EN ; Post Install entry point (from build).
; Set Up Kernel Checkpoints.
N DVBCKPT,DVBCKPTIEN
F DVBCKPT="POST" D
.S DVBCKPTIEN=$$NEWCP^XPDUTL(DVBCKPT,DVBCKPT_"^DVB4P66")
.I 'DVBCKPTIEN D
..D BMES^XPDUTL("ERROR Creating "_DVBCKPT_" Checkpoint.")
..D BMES^XPDUTL("Please verify that this post-install routine runs to completion.")
Q
POST ; Post install entry point (manual).
N DVBPID,DVBTMP,DVBTMPRT
S DVBPID="DVB*4.0*66",DVBTMPRT="^TMPRT(""DVB4P66"",$J)"
K @DVBTMPRT
S @DVBTMPRT=DT_U_"DVB*4.0*66 Post Install"
D DELICD,ADDICD
;DVB*4.0*66 - ADDCOND, no disability conditions were added.
K @DVBTMPRT
Q
ADDCOND ;Add Disability Conditions to DISABILITY CONDITION (#31) file.
D BMES^XPDUTL(" Adding disability conditions to the DISABILITY CONDITION (#31) file. ")
N DVBTOT,DVBTMP
S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"ADDCOND"))
K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add disability conditions."_U_$$NOW^XLFDT
D POST^DVB4P66A(DVBTMP,.DVBTOT)
S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
D ERROR(DVBTMP,"add conditions")
Q
DELICD ;Inactivate ICD codes associated with DISABILITY CONDITION (#31) file.
D BMES^XPDUTL(" Inactivating codes ICD codes from the DISABILITY CONDITION (#31) file. ")
N DVBTOT,DVBTMP
S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"DELICD"))
K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, inactivate ICD codes."_U_$$NOW^XLFDT
D POST^DVB4P66I(DVBTMP,.DVBTOT)
S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
D ERROR(DVBTMP,"delete")
Q
ADDICD ;Add ICD codes to DISABILITY CONDITION (#31) file.
D BMES^XPDUTL(" Adding ICD codes to the DISABILITY CONDITION (#31) file. ")
N DVBTOT,DVBTMP
S DVBTOT=0,DVBTMP=$NA(^TMP("DVB4P66",$J,"ADDICD"))
K @DVBTMP S @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add ICD codes."_U_$$NOW^XLFDT
D POST^DVB4P66A(DVBTMP,.DVBTOT)
S @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
D ERROR(DVBTMP,"add")
Q
ERROR(DVBTMP,DVBPHASE) ;Error Handling/Notification
;DVBTMP - Global Root containing error.
;DVBPHASE - Phase of installation.
I '$D(@DVBTMP@("ERROR")) D Q
.D BMES^XPDUTL(" >>> *** SUCCESS updating the DISABILITY CONDITION (#31) file.")
.D MES^XPDUTL(" Total RELATED ICD9 CODES "_DVBPHASE_"ed: "_DVBTOT)
.;
D BMES^XPDUTL(" >>> *** FAILURE updating the DISABILITY CONDITION (#31) file.")
D BMES^XPDUTL(" Filing errors have occurred when updating the file.")
D MES^XPDUTL(" Resolution is necessary to maintain database integrity.")
D BMES^XPDUTL(" A MailMan message has been sent to the installer of this patch")
D MES^XPDUTL(" with a listing of the errors.")
D BMES^XPDUTL(" Once these errors have been resolved, please re-run")
D MES^XPDUTL(" the Post-Installation routine directly from programmer mode")
D MES^XPDUTL(" by entering the following command:")
D MES^XPDUTL(" ")
D MES^XPDUTL(" D POST^DVB4P66")
D MES^XPDUTL(" ")
D BMES^XPDUTL(" >>> I'm now creating and sending the MailMan message...")
;
D SENDMSG(DVBTMP,.DVBTOT)
;
D MES^XPDUTL(" >>> All done.")
;
;cleanup temp file
K @DVBTMP
Q
;
;
SENDMSG(DVBTMP,DVBTOT) ;send failure MailMan message to installer of patch
;
N DIFROM,DVBMSG
N XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
S XMSUB="DVB*4.0*66 Patch Post-Install Error Listing"
S XMTEXT="DVBMSG("
S XMY(DUZ)="",XMDUZ=.5
;S XMDUZ=.5,(XMY(DUZ),XMY(XMDUZ))=""
S DVBMSG(1)="Patch: DVB*4.0*66 Automated Service Connected Designation"
S DVBMSG(2)=""
S DVBMSG(3)="The post-installation update of the DISABILITY CONDITION (#31) file"
S DVBMSG(4)="has FAILED to successfully complete. Errors have occurred when"
S DVBMSG(5)="attempting to make the changes."
S DVBMSG(6)=""
S DVBMSG(7)="Resolution of ALL errors is needed to maintain database integrity."
S DVBMSG(8)=""
S DVBMSG(9)="Once these filing errors have been resolved, please re-run"
S DVBMSG(10)="the Post-Installation routine directly from programmer mode"
S DVBMSG(11)="by entering the following command:"
S DVBMSG(12)=""
S DVBMSG(13)="D POST^DVB4P66"
S DVBMSG(14)=""
S DVBMSG(15)="The new update run time should take less than 5 minutes to complete."
S DVBMSG(16)=""
S DVBMSG(17)=">>> Please review and resolve the following errors:"
S DVBMSG(18)=""
S DVBMSG(19)="*** DISABILITY CONDITION FILE (#31) FILING ERRORS ***"
S DVBMSG(20)="-----------------------------------------------------"
;
;loop and list errors
N DVBICD,DVBHDR,DVBHDR1,DVBIEN,DVBLN,DVBMSS,DVBVBA,DVBDESC
S DVBHDR="VBA DX CODE: ",DVBHDR1=" ICD DIAGNOSIS CODE: "
S DVBLN=21,DVBVBA=0
F S DVBVBA=$O(@DVBTMP@("ERROR",DVBVBA)) Q:'DVBVBA D
.I $D(@DVBTMP@("ERROR",DVBVBA,0)) D Q
..S DVBMSS=DVBHDR_DVBVBA_" - "_$G(@DVBTMP@("ERROR",DVBVBA,0))
..S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
.K DVBDESC D FIND^DIC(31,"","","X",DVBVBA,,"C","","","DVBDESC")
.S DVBMSS=DVBHDR_DVBVBA_" - "_$E($G(DVBDESC("DILIST",1,1)),1,50)
.S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
.S DVBIEN=0
.F S DVBIEN=$O(@DVBTMP@("ERROR",DVBVBA,DVBIEN)) Q:'DVBIEN D
..S DVBICD=""
..F S DVBICD=$O(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD)) Q:DVBICD="" D
...S DVBMSS=DVBHDR1_DVBICD_" - "_$G(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD))
...S DVBMSG(DVBLN)=DVBMSS,DVBLN=DVBLN+1
S DVBMSG(DVBLN)="",DVBLN=DVBLN+1
S DVBMSG(DVBLN)="<End of Report>"
;
D ^XMD
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVB4P66 5490 printed Dec 13, 2024@01:57:50 Page 2
DVB4P66 ;ALB/MJB/RC - DISABILITY FILE UPDATE ; 11/16/10 3:50pm
+1 ;;4.0;HINQ;**66**;03/25/92;Build 14
+2 ;
+3 QUIT
EN ; Post Install entry point (from build).
+1 ; Set Up Kernel Checkpoints.
+2 NEW DVBCKPT,DVBCKPTIEN
+3 FOR DVBCKPT="POST"
Begin DoDot:1
+4 SET DVBCKPTIEN=$$NEWCP^XPDUTL(DVBCKPT,DVBCKPT_"^DVB4P66")
+5 IF 'DVBCKPTIEN
Begin DoDot:2
+6 DO BMES^XPDUTL("ERROR Creating "_DVBCKPT_" Checkpoint.")
+7 DO BMES^XPDUTL("Please verify that this post-install routine runs to completion.")
End DoDot:2
End DoDot:1
+8 QUIT
POST ; Post install entry point (manual).
+1 NEW DVBPID,DVBTMP,DVBTMPRT
+2 SET DVBPID="DVB*4.0*66"
SET DVBTMPRT="^TMPRT(""DVB4P66"",$J)"
+3 KILL @DVBTMPRT
+4 SET @DVBTMPRT=DT_U_"DVB*4.0*66 Post Install"
+5 DO DELICD
DO ADDICD
+6 ;DVB*4.0*66 - ADDCOND, no disability conditions were added.
+7 KILL @DVBTMPRT
+8 QUIT
ADDCOND ;Add Disability Conditions to DISABILITY CONDITION (#31) file.
+1 DO BMES^XPDUTL(" Adding disability conditions to the DISABILITY CONDITION (#31) file. ")
+2 NEW DVBTOT,DVBTMP
+3 SET DVBTOT=0
SET DVBTMP=$NAME(^TMP("DVB4P66",$JOB,"ADDCOND"))
+4 KILL @DVBTMP
SET @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add disability conditions."_U_$$NOW^XLFDT
+5 DO POST^DVB4P66A(DVBTMP,.DVBTOT)
+6 SET @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
+7 DO ERROR(DVBTMP,"add conditions")
+8 QUIT
DELICD ;Inactivate ICD codes associated with DISABILITY CONDITION (#31) file.
+1 DO BMES^XPDUTL(" Inactivating codes ICD codes from the DISABILITY CONDITION (#31) file. ")
+2 NEW DVBTOT,DVBTMP
+3 SET DVBTOT=0
SET DVBTMP=$NAME(^TMP("DVB4P66",$JOB,"DELICD"))
+4 KILL @DVBTMP
SET @DVBTMP@(0)="Patch DVB*4.0*66 post-install, inactivate ICD codes."_U_$$NOW^XLFDT
+5 DO POST^DVB4P66I(DVBTMP,.DVBTOT)
+6 SET @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
+7 DO ERROR(DVBTMP,"delete")
+8 QUIT
ADDICD ;Add ICD codes to DISABILITY CONDITION (#31) file.
+1 DO BMES^XPDUTL(" Adding ICD codes to the DISABILITY CONDITION (#31) file. ")
+2 NEW DVBTOT,DVBTMP
+3 SET DVBTOT=0
SET DVBTMP=$NAME(^TMP("DVB4P66",$JOB,"ADDICD"))
+4 KILL @DVBTMP
SET @DVBTMP@(0)="Patch DVB*4.0*66 post-install, add ICD codes."_U_$$NOW^XLFDT
+5 DO POST^DVB4P66A(DVBTMP,.DVBTOT)
+6 SET @DVBTMP@(0)=@DVBTMP@(0)_"^"_$$NOW^XLFDT_"^"_DVBTOT
+7 DO ERROR(DVBTMP,"add")
+8 QUIT
ERROR(DVBTMP,DVBPHASE) ;Error Handling/Notification
+1 ;DVBTMP - Global Root containing error.
+2 ;DVBPHASE - Phase of installation.
+3 IF '$DATA(@DVBTMP@("ERROR"))
Begin DoDot:1
+4 DO BMES^XPDUTL(" >>> *** SUCCESS updating the DISABILITY CONDITION (#31) file.")
+5 DO MES^XPDUTL(" Total RELATED ICD9 CODES "_DVBPHASE_"ed: "_DVBTOT)
+6 ;
End DoDot:1
QUIT
+7 DO BMES^XPDUTL(" >>> *** FAILURE updating the DISABILITY CONDITION (#31) file.")
+8 DO BMES^XPDUTL(" Filing errors have occurred when updating the file.")
+9 DO MES^XPDUTL(" Resolution is necessary to maintain database integrity.")
+10 DO BMES^XPDUTL(" A MailMan message has been sent to the installer of this patch")
+11 DO MES^XPDUTL(" with a listing of the errors.")
+12 DO BMES^XPDUTL(" Once these errors have been resolved, please re-run")
+13 DO MES^XPDUTL(" the Post-Installation routine directly from programmer mode")
+14 DO MES^XPDUTL(" by entering the following command:")
+15 DO MES^XPDUTL(" ")
+16 DO MES^XPDUTL(" D POST^DVB4P66")
+17 DO MES^XPDUTL(" ")
+18 DO BMES^XPDUTL(" >>> I'm now creating and sending the MailMan message...")
+19 ;
+20 DO SENDMSG(DVBTMP,.DVBTOT)
+21 ;
+22 DO MES^XPDUTL(" >>> All done.")
+23 ;
+24 ;cleanup temp file
+25 KILL @DVBTMP
+26 QUIT
+27 ;
+28 ;
SENDMSG(DVBTMP,DVBTOT) ;send failure MailMan message to installer of patch
+1 ;
+2 NEW DIFROM,DVBMSG
+3 NEW XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
+4 SET XMSUB="DVB*4.0*66 Patch Post-Install Error Listing"
+5 SET XMTEXT="DVBMSG("
+6 SET XMY(DUZ)=""
SET XMDUZ=.5
+7 ;S XMDUZ=.5,(XMY(DUZ),XMY(XMDUZ))=""
+8 SET DVBMSG(1)="Patch: DVB*4.0*66 Automated Service Connected Designation"
+9 SET DVBMSG(2)=""
+10 SET DVBMSG(3)="The post-installation update of the DISABILITY CONDITION (#31) file"
+11 SET DVBMSG(4)="has FAILED to successfully complete. Errors have occurred when"
+12 SET DVBMSG(5)="attempting to make the changes."
+13 SET DVBMSG(6)=""
+14 SET DVBMSG(7)="Resolution of ALL errors is needed to maintain database integrity."
+15 SET DVBMSG(8)=""
+16 SET DVBMSG(9)="Once these filing errors have been resolved, please re-run"
+17 SET DVBMSG(10)="the Post-Installation routine directly from programmer mode"
+18 SET DVBMSG(11)="by entering the following command:"
+19 SET DVBMSG(12)=""
+20 SET DVBMSG(13)="D POST^DVB4P66"
+21 SET DVBMSG(14)=""
+22 SET DVBMSG(15)="The new update run time should take less than 5 minutes to complete."
+23 SET DVBMSG(16)=""
+24 SET DVBMSG(17)=">>> Please review and resolve the following errors:"
+25 SET DVBMSG(18)=""
+26 SET DVBMSG(19)="*** DISABILITY CONDITION FILE (#31) FILING ERRORS ***"
+27 SET DVBMSG(20)="-----------------------------------------------------"
+28 ;
+29 ;loop and list errors
+30 NEW DVBICD,DVBHDR,DVBHDR1,DVBIEN,DVBLN,DVBMSS,DVBVBA,DVBDESC
+31 SET DVBHDR="VBA DX CODE: "
SET DVBHDR1=" ICD DIAGNOSIS CODE: "
+32 SET DVBLN=21
SET DVBVBA=0
+33 FOR
SET DVBVBA=$ORDER(@DVBTMP@("ERROR",DVBVBA))
if 'DVBVBA
QUIT
Begin DoDot:1
+34 IF $DATA(@DVBTMP@("ERROR",DVBVBA,0))
Begin DoDot:2
+35 SET DVBMSS=DVBHDR_DVBVBA_" - "_$GET(@DVBTMP@("ERROR",DVBVBA,0))
+36 SET DVBMSG(DVBLN)=DVBMSS
SET DVBLN=DVBLN+1
End DoDot:2
QUIT
+37 KILL DVBDESC
DO FIND^DIC(31,"","","X",DVBVBA,,"C","","","DVBDESC")
+38 SET DVBMSS=DVBHDR_DVBVBA_" - "_$EXTRACT($GET(DVBDESC("DILIST",1,1)),1,50)
+39 SET DVBMSG(DVBLN)=DVBMSS
SET DVBLN=DVBLN+1
+40 SET DVBIEN=0
+41 FOR
SET DVBIEN=$ORDER(@DVBTMP@("ERROR",DVBVBA,DVBIEN))
if 'DVBIEN
QUIT
Begin DoDot:2
+42 SET DVBICD=""
+43 FOR
SET DVBICD=$ORDER(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD))
if DVBICD=""
QUIT
Begin DoDot:3
+44 SET DVBMSS=DVBHDR1_DVBICD_" - "_$GET(@DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD))
+45 SET DVBMSG(DVBLN)=DVBMSS
SET DVBLN=DVBLN+1
End DoDot:3
End DoDot:2
End DoDot:1
+46 SET DVBMSG(DVBLN)=""
SET DVBLN=DVBLN+1
+47 SET DVBMSG(DVBLN)="<End of Report>"
+48 ;
+49 DO ^XMD
+50 QUIT
+51 ;