Changeset 440
- Timestamp:
- May 5, 2009, 2:58:05 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CBAT.m
r439 r440 19 19 ; 20 20 W "This is the CCR Batch Utility Library ",! 21 Q 22 ; 23 STOP ; STOP A CURRENTLY RUNNING BATCH JOB 24 I '$D(^TMP("C0CBAT","RUNNING")) Q ; 25 W !,!,"HALTING CCR BATCH",! 26 S ^TMP("C0CBAT","STOP")="" ; SIGNAL JOB TO TERMINATE 27 H 10 ; WAIT TEN SECONDS FOR SIGNAL TO BE RECEIVED 28 I '$D(^TMP("C0CBAT","STOP")) D ; SIGNAL RECEIVED 29 . W "CCR BATCH JOB TERMINATING",! 30 E K ^TMP("C0CBAT","STOP") ; STOP SIGNALING 31 Q 32 ; 33 START ; STARTS A TAKSMAN CCR BATCH JOB - FOR USE IN A MENU OPTION 34 ; 35 I $D(^TMP("C0CBAT","RUNNING")) D Q ; ONLY ONE ALLOWED AT A TIME 36 . W !,"CCR BATCH ALREADY RUNNING",! 37 . W !,"STOP FIRST WITH STOP^C0CBAT",! 38 N ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTSK,ZTIO 39 S ZTRTN="EN^C0CBAT",ZTDESC="CCR Batch" 40 S ZTDTH=$H ; 41 ;S ZTDTH=$S(($P(ZTDTH,",",2)+10)\86400:(1+ZTDTH)_","_((($P(ZTDTH,",",2)+10)#86400)/100000),1:(+ZTDTH)_","_($P(ZTDTH,",",2)+10)) 42 S ZTSAVE("C0C")="",ZTSAVE("C0C*")="" 43 S ZTIO="NULL" ; 44 W !,!,"CCR BATCH JOB STARTED",! 45 D ^%ZTLOAD 21 46 Q 22 47 ; … … 28 53 ; 29 54 S C0CQT=1 ; QUIET MODE 55 I $D(^TMP("C0CBAT","RUNNING")) Q ; ONLY ONE AT A TIME 56 S ^TMP("C0CBAT","RUNNING")="" ; RUNNING SIGNAL 30 57 S C0CBDT=$$NOW^XLFDT ; DATE OF THIS RUN 31 58 S C0CBF=177.301 ; FILE NUMBER OF C0C BATCH CONTROL FILE 59 S C0CBFR=177.3013 ; FILE NUMBER OF UPDATE SUBFILE 32 60 S C0CBB=$NA(^TMP("C0CBATCH",C0CBDT)) ; BATCH WORK AREA 33 61 I $D(@C0CBB@(0)) D ; ERROR SHOULDN'T EXIST 34 62 . W "WORK AREA ERROR",! 35 63 . B 36 S @C0CBB@(0)="V2 1" ; VERSION USED TO CREATE THIS WORK AREA64 S @C0CBB@(0)="V22" ; VERSION USED TO CREATE THIS WORK AREA 37 65 S C0CBH=$NA(@C0CBB@("HOTLIST")) ; BASE FOR HOT LIST 38 66 S C0CBS=$NA(^C0CS("B")) ; SUBSCRIPTION LIST BASE … … 52 80 S (C0CN,C0CNH)=0 ; COUNTERS FOR TOTAL AND HOT LIST 53 81 S C0CBCUR="" ; CURRENT PATIENT 82 S C0CSTOP=0 ; STOP FLAG FOR HALTING BATCH SET ^TMP("C0CBAT","STOP")="" 54 83 ;F S C0CBCUR=$O(@C0CBH@(C0CBCUR),-1) Q:C0CBCUR="" D ; HOT LIST LATEST FIRST 55 F S C0CBCUR=$O(@C0CBH@(C0CBCUR)) Q: C0CBCUR="" D ; HOT LIST FIRST FIRST84 F S C0CBCUR=$O(@C0CBH@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="") D ; HOT LIST FIRST 56 85 . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-760^VITLIMIT:T-760") 57 . D PUTRIM^C0CFM2(C0CBCUR) 58 . I $G(C0CCHK) D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR 86 . I $G(C0CCHK) D ; 87 . . D PUTRIM^C0CFM2(C0CBCUR) 88 . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR 89 . . K C0CFDA 90 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR 91 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y" 92 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR)) 93 . . D UPDIE ; CREATE UPDATE SUBFILE 59 94 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL 60 95 . S C0CNH=C0CNH+1 ; INCREMENT HOT LIST TOTAL … … 70 105 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME 71 106 . D UPDIE ; 107 . I $D(^TMP("C0CBAT","STOP")) D ; IF STOP SIGNAL DETECTED 108 . . S C0CSTOP=1 109 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED 72 110 . H 1 ; GIVE OTHERS A CHANCE 73 F S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q: C0CBCUR="" D ; REMAINING SUBSCRIPTIONLIST111 F S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="") D ; SUBS LIST 74 112 . I $D(@C0CBH@(C0CBCUR)) Q ; SKIP IF IN HOT LIST - ALREADY DONE 75 113 . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-760^VITLIMIT:T-760") 76 . D PUTRIM^C0CFM2(C0CBCUR) 77 . I $G(C0CCHK) D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR 114 . I $G(C0CCHK) D ; 115 . . D PUTRIM^C0CFM2(C0CBCUR) 116 . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR 117 . . K C0CFDA 118 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR 119 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y" 120 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR)) 121 . . D UPDIE ; CREATE UPDATE SUBFILE 78 122 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL 79 123 . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS … … 87 131 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME 88 132 . D UPDIE ; 133 . I $D(^TMP("C0CBAT","STOP")) D ; IF STOP SIGNAL DETECTED 134 . . S C0CSTOP=1 135 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED 89 136 . H 1 ; GIVE IT A BREAK 137 K ^TMP("C0CBAT","RUNNING") 90 138 Q 91 139 ; -
ccr/trunk/p/C0CCCR.m
r431 r440 41 41 S OARY=$NA(^TMP("C0CCCR",$J,DFN,"CCR",1)) 42 42 S ONAM=UFN 43 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_2 1.xml"43 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_22.xml" 44 44 S ODIRGLB=$NA(^TMP("C0CCCR","ODIR")) 45 S ^TMP("C0CCCR","FNAME",DFN)=UFN ; FILE NAME FOR BATCH USE 45 46 I $D(^TMP("GPLCCR","ODIR")) S @ODIRGLB=^TMP("GPLCCR","ODIR") 46 47 I '$D(@ODIRGLB) D ; IF NOT ODIR HAS BEEN SET
Note:
See TracChangeset
for help on using the changeset viewer.