updated batch processing
This commit is contained in:
parent
df532cf080
commit
6883418d30
16
p/C0CBAT.m
16
p/C0CBAT.m
|
@ -36,6 +36,10 @@ EN ; BATCH ENTRY POINT
|
|||
S @C0CBB@(0)="V21" ; VERSION USED TO CREATE THIS WORK AREA
|
||||
S C0CBH=$NA(@C0CBB@("HOTLIST")) ; BASE FOR HOT LIST
|
||||
S C0CBS=$NA(^C0CS("B")) ; SUBSCRIPTION LIST BASE
|
||||
;I $D(^C0CB("B",C0CDT)) D ; BATCH RECORD EXISTS
|
||||
;. H 10 ; HANG 10 SECONDS
|
||||
;. S C0CBDT=$$NOW^XLFDT ; NEW DATE FOR THIS RUN
|
||||
;. I $D(^C0CB("B",C0CDT)) B ;DIDN'T WORK
|
||||
D BLDHOT(C0CBH) ; BUILD THE HOT LIST
|
||||
S C0CHN=$$COUNT(C0CBH) ;COUNT NUMBER IN HOT LIST
|
||||
S C0CSN=$$COUNT(C0CBS) ;COUNT NUMBER OF PATIENTS WITH SUBSCRIPTIONS
|
||||
|
@ -57,14 +61,15 @@ EN ; BATCH ENTRY POINT
|
|||
. S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",2.1)=C0CNH ; UPDATE HOT LIST PROGRESS
|
||||
. S C0CNOW=$$NOW^XLFDT
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
|
||||
. S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
|
||||
. S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
|
||||
. S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
|
||||
. S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
|
||||
. D UPDIE ;
|
||||
. D UPDIE ;
|
||||
. H 1 ; GIVE OTHERS A CHANCE
|
||||
F S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:C0CBCUR="" D ; REMAINING SUBSCRIPTION LIST
|
||||
. I $D(@C0CBH@(C0CBCUR)) Q ; SKIP IF IN HOT LIST - ALREADY DONE
|
||||
. D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-760^VITLIMIT:T-760")
|
||||
|
@ -73,14 +78,15 @@ EN ; BATCH ENTRY POINT
|
|||
. S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
|
||||
. S C0CNOW=$$NOW^XLFDT
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
|
||||
. S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
|
||||
. S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
|
||||
. S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
|
||||
. S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
|
||||
. S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
|
||||
. D UPDIE ;
|
||||
. H 1 ; GIVE IT A BREAK
|
||||
Q
|
||||
;
|
||||
BLDHOT(ZHB) ; BUILD HOT LIST AT GLOBAL ZHB, PASSED BY NAME
|
||||
|
|
Loading…
Reference in New Issue