source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCGPM.m@ 836

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1PRCGPM ;WIRMFO@ALTOONA/CTB/WIRMFO/PLT - IFCAP PURGEMASTER PROCESS ;12/10/97 9:17 AM
2V ;;5.1;IFCAP;**95**;Oct 20, 2000
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;THIS ROUTINE SHOULD BE TASKED TO RUN DAILY AT WHATEVER TIME
5 ;THE IRM STAFF FEELS IS APPROPRIATE. IT SHOULD BE RESCHEDULED
6 ;TO RUN DAILY. ITS JOB IS TO SPAWN THE APPROPRIATE NUMBER OF
7 ;'KILLER' JOBS (^PRCGPMK) AS SPECIFIED IN FILE 443.2.
8 ;
9 ;IF LEFTOVER INPROCESS JOBS REMAIN IN FILE 443.3, AND THEY ARE OVER
10 ; 1 DAY OLD, THEY WILL BE ADDED TO FILE 443.1 HERE
11 I $O(^PRC(443.3,0)) DO
12 . NEW DA,TODAY,NODE,NODE1,ROU,VARIABLE,MSG
13 . S TODAY=+$H,DA=0
14 . F S DA=$O(^PRC(443.3,DA)) Q:'DA DO
15 . . S NODE=$G(^PRC(443.3,DA,0)) I NODE="" D REMIP^PRCGPM1(DA) QUIT
16 . . S NODE1=$G(^PRC(443.3,DA,1)) I NODE1="" D REMIP^PRCGPM1(DA) QUIT
17 . . S ROU=$P(NODE,"^",2,3),VARIABLE=$P(NODE,"^",4) I ROU="" D REMIP^PRCGPM1(DA) QUIT
18 . . S DATE=+NODE1 Q:TODAY'>DATE
19 . . D ADD^PRCGPM1(ROU,VARIABLE,.MSG)
20 . . I MSG D REMIP^PRCGPM1(DA)
21 . . QUIT
22 . QUIT
23 D CLN445^PRCGPM1
24 ;IT WILL ONLY SPAWN 'SUB-MANAGER' JOBS IF THERE ARE ENTRIES IN
25 ;FILE 443.1
26 S PARAM=^PRC(443.2,1,0),$P(PARAM,"^",7)=$H
27 S STOP=$P(PARAM,"^",3),SAT=$P(PARAM,"^",4),SUN=$P(PARAM,"^",5),HOL=$P(PARAM,"^",6),START=$P(PARAM,"^",7)
28 S X=DT_"."_STOP D H^%DTC S STOP=%T
29 I STOP<$P(START,",",2) S STOP=($P(START,",",1)+1)_","_STOP
30 E S STOP=$P(START,",",1)_","_STOP
31 S %H=STOP D YMD^%DTC
32 D DOW^%DTC
33 I ((SAT&(Y=6))!(SUN&(Y=7))!(HOL&($D(^HOLIDAY(X))))) S $P(STOP,",",2)=$P(START,",",2),STOP=($P(STOP,",")+1)_","_$P(STOP,",",2)
34 S NEXTVOL=0 F S NEXTVOL=$O(^PRC(443.2,1,1,NEXTVOL)) Q:'NEXTVOL D
35 . N X,CPU S X=$G(^PRC(443.2,1,1,NEXTVOL,0)) Q:X=""
36 . S CPU=$P(X,"^"),NUMJOB=$P(X,"^",2)
37 . F ZII=1:1:NUMJOB D
38 . . S ZTCPU=CPU,ZTRTN="PRCGPMK",ZTDESC="IFCAP PurgeMaster Process",ZTIO="",ZTDTH=$H
39 . . S ZTSAVE("STOP")="",ZTKIL=$H+2_",0"
40 . . D ^%ZTLOAD W:'$D(ZTQUEUED) !,ZTSK
41 . . QUIT
42 . QUIT
43 Q
Note: See TracBrowser for help on using the repository browser.