Changeset 440 for ccr/trunk


Ignore:
Timestamp:
May 5, 2009, 2:58:05 PM (16 years ago)
Author:
George Lilly
Message:

updates to Batch processing

Location:
ccr/trunk/p
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CBAT.m

    r439 r440  
    1919 ;
    2020 W "This is the CCR Batch Utility Library ",!
     21 Q
     22 ;
     23STOP ; 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 ;
     33START ; 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
    2146 Q
    2247 ;
     
    2853 ;
    2954 S C0CQT=1 ; QUIET MODE
     55 I $D(^TMP("C0CBAT","RUNNING")) Q  ; ONLY ONE AT A TIME
     56 S ^TMP("C0CBAT","RUNNING")="" ; RUNNING SIGNAL
    3057 S C0CBDT=$$NOW^XLFDT ; DATE OF THIS RUN
    3158 S C0CBF=177.301 ; FILE NUMBER OF C0C BATCH CONTROL FILE
     59 S C0CBFR=177.3013 ; FILE NUMBER OF UPDATE SUBFILE
    3260 S C0CBB=$NA(^TMP("C0CBATCH",C0CBDT)) ; BATCH WORK AREA
    3361 I $D(@C0CBB@(0)) D  ; ERROR SHOULDN'T EXIST
    3462 . W "WORK AREA ERROR",!
    3563 . B
    36  S @C0CBB@(0)="V21" ; VERSION USED TO CREATE THIS WORK AREA
     64 S @C0CBB@(0)="V22" ; VERSION USED TO CREATE THIS WORK AREA
    3765 S C0CBH=$NA(@C0CBB@("HOTLIST")) ; BASE FOR HOT LIST
    3866 S C0CBS=$NA(^C0CS("B")) ; SUBSCRIPTION LIST BASE
     
    5280 S (C0CN,C0CNH)=0 ; COUNTERS FOR TOTAL AND HOT LIST
    5381 S C0CBCUR="" ; CURRENT PATIENT
     82 S C0CSTOP=0 ; STOP FLAG FOR HALTING BATCH SET ^TMP("C0CBAT","STOP")=""
    5483 ;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 FIRST
     84 F  S C0CBCUR=$O(@C0CBH@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; HOT LIST FIRST
    5685 . 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
    5994 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
    6095 . S C0CNH=C0CNH+1 ; INCREMENT HOT LIST TOTAL
     
    70105 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
    71106 . D UPDIE ;
     107 . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
     108 . . S C0CSTOP=1
     109 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
    72110 . H 1 ; GIVE OTHERS A CHANCE
    73  F  S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:C0CBCUR=""  D  ; REMAINING SUBSCRIPTION LIST
     111 F  S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; SUBS LIST
    74112 . I $D(@C0CBH@(C0CBCUR)) Q  ; SKIP IF IN HOT LIST - ALREADY DONE
    75113 . 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
    78122 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
    79123 . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
     
    87131 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
    88132 . D UPDIE ;
     133 . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
     134 . . S C0CSTOP=1
     135 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
    89136 . H 1 ; GIVE IT A BREAK
     137 K ^TMP("C0CBAT","RUNNING")
    90138 Q
    91139 ;
  • ccr/trunk/p/C0CCCR.m

    r431 r440  
    4141 S OARY=$NA(^TMP("C0CCCR",$J,DFN,"CCR",1))
    4242 S ONAM=UFN
    43  I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_21.xml"
     43 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_22.xml"
    4444 S ODIRGLB=$NA(^TMP("C0CCCR","ODIR"))
     45 S ^TMP("C0CCCR","FNAME",DFN)=UFN ; FILE NAME FOR BATCH USE
    4546 I $D(^TMP("GPLCCR","ODIR")) S @ODIRGLB=^TMP("GPLCCR","ODIR")
    4647 I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
Note: See TracChangeset for help on using the changeset viewer.