KMPDBD01 ;OAK/RAK/JML - CM Tools Background Driver ;6/1/2020
;;4.0;CAPACITY MANAGEMENT;**1**;Jan 15, 2013;Build 27
;
EN ;-entry point for background driver
;
S:'$G(DT) DT=$$DT^XLFDT
;
N DAILY,STR
;
; update cpu data in file #8973 (CP PARAMETERS)
D CPUSET^KMPDUTL6(1)
;
; hl7
;compile and store daily stats in file 8973.1 (CM HL7 DATA)
; NOTE: HL7 data sent via VSM nightly job
;S STR=$$NOW^XLFDT,DAILY=$$FMADD^XLFDT(DT,-1)
;D DAILY^KMPDHU02(DAILY,DAILY)
; store start, stop and delta times for daily background job
;D STRSTP^KMPDUTL2(3,1,1,STR)
;
; timing
; send raw numbers to CPE database
D ^KMPDRDAT
; compile and store timing stats in file 8973.2 (CP TIMING)
S STR=$$NOW^XLFDT
D DAILY^KMPDTU02
; store start, stop and delta times for daily background job
D STRSTP^KMPDUTL2(4,1,1,STR)
;
; transmit 'yesterdays' daily stats to national database
S STR=$$NOW^XLFDT,DAILY=$$FMADD^XLFDT(DT,-1)
D DAILY^KMPDTU01(DAILY)
; store start, stop and delta times for daily background job
D STRSTP^KMPDUTL2(4,2,1,STR)
;
;
; if sunday
D:'$$DOW^XLFDT(DT,1) SUNDAY
;
Q
;
SUNDAY ;-- weekly
;
N STR
;
S:'$G(DT) DT=$$DT^XLFDT
;
; hl7 - compress & transmit hl7 data to cm national
; database, and purge file #8973.1 (CM HL7 DATA) of old data
S STR=$$NOW^XLFDT
D WEEKLY^KMPDHU01(DT,1)
; store start, stop and delta times for weekly background job
D STRSTP^KMPDUTL2(3,2,1,STR)
;
; purge entries from file 8973.2 (CP TIMING)
S STR=$$NOW^XLFDT
D PURGE1^KMPDUTL3
D STRSTP^KMPDUTL2(4,2,2,STR)
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDBD01 1589 printed Dec 13, 2024@01:40:30 Page 2
KMPDBD01 ;OAK/RAK/JML - CM Tools Background Driver ;6/1/2020
+1 ;;4.0;CAPACITY MANAGEMENT;**1**;Jan 15, 2013;Build 27
+2 ;
EN ;-entry point for background driver
+1 ;
+2 if '$GET(DT)
SET DT=$$DT^XLFDT
+3 ;
+4 NEW DAILY,STR
+5 ;
+6 ; update cpu data in file #8973 (CP PARAMETERS)
+7 DO CPUSET^KMPDUTL6(1)
+8 ;
+9 ; hl7
+10 ;compile and store daily stats in file 8973.1 (CM HL7 DATA)
+11 ; NOTE: HL7 data sent via VSM nightly job
+12 ;S STR=$$NOW^XLFDT,DAILY=$$FMADD^XLFDT(DT,-1)
+13 ;D DAILY^KMPDHU02(DAILY,DAILY)
+14 ; store start, stop and delta times for daily background job
+15 ;D STRSTP^KMPDUTL2(3,1,1,STR)
+16 ;
+17 ; timing
+18 ; send raw numbers to CPE database
+19 DO ^KMPDRDAT
+20 ; compile and store timing stats in file 8973.2 (CP TIMING)
+21 SET STR=$$NOW^XLFDT
+22 DO DAILY^KMPDTU02
+23 ; store start, stop and delta times for daily background job
+24 DO STRSTP^KMPDUTL2(4,1,1,STR)
+25 ;
+26 ; transmit 'yesterdays' daily stats to national database
+27 SET STR=$$NOW^XLFDT
SET DAILY=$$FMADD^XLFDT(DT,-1)
+28 DO DAILY^KMPDTU01(DAILY)
+29 ; store start, stop and delta times for daily background job
+30 DO STRSTP^KMPDUTL2(4,2,1,STR)
+31 ;
+32 ;
+33 ; if sunday
+34 if '$$DOW^XLFDT(DT,1)
DO SUNDAY
+35 ;
+36 QUIT
+37 ;
SUNDAY ;-- weekly
+1 ;
+2 NEW STR
+3 ;
+4 if '$GET(DT)
SET DT=$$DT^XLFDT
+5 ;
+6 ; hl7 - compress & transmit hl7 data to cm national
+7 ; database, and purge file #8973.1 (CM HL7 DATA) of old data
+8 SET STR=$$NOW^XLFDT
+9 DO WEEKLY^KMPDHU01(DT,1)
+10 ; store start, stop and delta times for weekly background job
+11 DO STRSTP^KMPDUTL2(3,2,1,STR)
+12 ;
+13 ; purge entries from file 8973.2 (CP TIMING)
+14 SET STR=$$NOW^XLFDT
+15 DO PURGE1^KMPDUTL3
+16 DO STRSTP^KMPDUTL2(4,2,2,STR)
+17 ;
+18 QUIT