source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DG53B563.m@ 1328

Last change on this file since 1328 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1DG53B563 ;ALB/PJR - DOD Enhancement Post-Install ; 12/30/04 3:53pm
2 ;;5.3;Registration;**563**; Aug 13,1993
3 ;This post install routine will loop through patient file (#2)
4 ;and delete the DEATH ENTERED BY field
5 ;for all entries that have NO value in the DATE OF DEATH field (#.351)
6 ;but DO have a value in the DEATH ENTERED BY field (#.352)
7 Q
8 ;
9EP ;Entry point
10 N OK
11 D CHK Q:'OK
12 D MSG
13 D QUETASK
14 Q
15 ;
16QUETASK ;Queue the task
17 N TXT,ZTRTN,ZTDESC,ZTSK,ZTIO,ZTDTH
18 S ZTRTN="EP1^DG53B563",ZTIO="",ZTDTH=$$NOW^XLFDT()
19 S ZTDESC="DOD ENHANCEMENT POST-INSTALL"
20 K ^XTMP("DG53B563")
21 D ^%ZTLOAD S ^XTMP("DG53B563","TASK")=ZTSK
22 S TXT(1)="Task: "_ZTSK_" Queued."
23 D BMES^XPDUTL(.TXT)
24 Q
25 ;
26EP1 ;Entry point
27 N ZCNT,ZIEN,ZEND,ZDATE,ZEDATE,DA,DIE,DR,ZCK,ZII,ZXX,X
28 L +^XTMP("DG53B563"):1 E Q
29 S (ZIEN,ZCNT)=0
30 S ZDATE=$$DT^XLFDT D DG53
31 S ^XTMP("DG53B563",0)=ZCNT_U_ZDATE_U_X
32 S $P(^XTMP("DG53B563","DATE"),"^")=$$FMTE^XLFDT($$NOW^XLFDT(),"5P")
33 D LMINUS
34 ;Loop through patient file
35 F S ZIEN=$O(^DPT(ZIEN)) Q:'ZIEN D
36 .S ZXX=$G(^DPT(ZIEN,.35)),ZCK=0 I ZXX=""!ZXX Q
37 .F ZII=1,2,3,5 I $P(ZXX,U,ZII)]"" S ZCK=1 D
38 ..S DA=ZIEN,DIE="^DPT(",DR=".35"_ZII_"////@" D ^DIE
39 .I ZCK S ZCNT=ZCNT+1 ;Tot records updated
40 S $P(^XTMP("DG53B563","DATE"),"^",2)=$$FMTE^XLFDT($$NOW^XLFDT(),"5P")
41 S ZDATE=$$DT^XLFDT,ZEDATE=$$FMTE^XLFDT(DT) D DG53
42 S ^XTMP("DG53B563",0)=ZCNT_U_ZDATE_U_X
43 S ^XTMP("DG53B563","COMPLETED")=1 D MAIL
44 D DG53 S X="The "_X_" process is complete."
45 D BMES^XPDUTL(X)
46 Q
47 ;
48CHK ;check for completion
49 N TXT,TASKNUM,STAT
50 S OK=1 L +^XTMP("DG53B563"):1 E D Q
51 .S OK=0 D DG53 S TXT(1)=X_" process has a lock table"
52 .S TXT(2)="problem. Nothing Done!"
53 .D BMES^XPDUTL(.TXT),LMINUS
54 ;
55 I $G(^XTMP("DG53B563","COMPLETED")) D Q
56 .S OK=0 D DG53 S TXT(1)=X_" process was completed in a"
57 .S TXT(2)="previous run. Nothing Done!"
58 .D BMES^XPDUTL(.TXT),LMINUS
59 ;
60 S TASKNUM=$G(^XTMP("DG53B563","TASK"))
61 I +TASKNUM D Q
62 .S STAT=$$ACTIVE(TASKNUM)
63 .I STAT>0 D
64 ..S OK=0 D DG53
65 ..S TXT(1)="Task: "_TASKNUM_" is currently running the"
66 ..S TXT(2)=X_" process."
67 ..S TXT(3)="Duplicate processes cannot be started."
68 ..D BMES^XPDUTL(.TXT)
69 .D LMINUS
70 ;
71 D LMINUS Q
72 ;
73MSG ;create bulletin message in install file.
74 N TXT
75 S TXT(1)="This Post Install routine will loop through the Patient (#2) file"
76 S TXT(2)="and delete the DEATH ENTERED BY field for all patients"
77 S TXT(3)="that have NO value in the DATE OF DEATH (#.531) field"
78 S TXT(4)="but DO have a value in the DEATH ENTERED BY field."
79 S TXT(5)=" "
80 D BMES^XPDUTL(.TXT)
81 Q
82 ;
83MAIL N SITE,STATN,SITENM,XMDUZ,XMSUB,XMY,XMTEXT,MSG
84 S SITE=$$SITE^VASITE,STATN=$P($G(SITE),"^",3),SITENM=$P($G(SITE),"^",2)
85 S:$$GET1^DIQ(869.3,"1,",.03,"I")'="P" STATN=STATN_" [TEST]"
86 D DG53 S XMDUZ=X,XMSUB=XMDUZ_" - "_STATN_" (DG*5.3*563)"
87 S (XMY(DUZ),XMY(.5))=""
88 S XMTEXT="MSG(" D DG53
89 S MSG(1)="The "_X_" process"
90 S MSG(2)="has completed successfully."
91 S MSG(3)="Task: "_$G(^XTMP("DG53B563","TASK"))
92 S MSG(4)=""
93 S MSG(5)="Site Station number: "_STATN
94 S MSG(6)="Site Name: "_SITENM
95 S MSG(7)=""
96 S MSG(8)="Process started at : "_$P($G(^XTMP("DG53B563","DATE")),"^",1)
97 S MSG(8)="Process completed at : "_$P($G(^XTMP("DG53B563","DATE")),"^",2)
98 S MSG(10)="Total Veterans updated: "_+$G(^XTMP("DG53B563",0))
99 D ^XMD
100 Q
101 ;
102 ;
103ACTIVE(TASK) ;Checks if task is running
104 ; input -- The taskman ID
105 ; output -- 1=The task is running
106 ; 0=The task is not running
107 N STAT,ZTSK,Y
108 S STAT=0,ZTSK=+TASK
109 D STAT^%ZTLOAD
110 S Y=ZTSK(1)
111 I Y=0 S STAT=-1
112 I ",1,2,"[(","_Y_",") S STAT=1
113 I ",3,5,"[(","_Y_",") S STAT=0
114 Q STAT
115DG53 S X="DG*5.3*563 DOD Post-Install cleanup DEATH ENTERED BY" Q
116LMINUS L -^XTMP("DG53B563") Q
Note: See TracBrowser for help on using the repository browser.