Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGJLS2.m

    r628 r636  
    11MAGJLS2 ;WIRMFO/JHC Rad. Workstation RPC calls ; 29 Jul 2003  9:58 AM
    2  ;;3.0;IMAGING;**22,18,76**;Jun 22, 2007;Build 19
    3  ;;Per VHA Directive 2004-038, this routine should not be modified.
     2 ;;3.0;IMAGING;**22,18**;Mar 07, 2006
    43 ;; +---------------------------------------------------------------+
    54 ;; | Property of the US Government.                                |
     
    1918 Q
    2019 ;  ACTIVE -- list exams (Unread, Recent, &/or Pending) for input Imaging Type(s)
    21  ;    RPC Call: MAGJ RADACTIVEEXAMS
     20 ;       RPC Call: MAGJ RADACTIVEEXAMS
    2221 ;  BKGND -- EP for Bkgnd Compile of UNREAD list
    2322 ;  BKGND2 -- EP for Bkgnd Compile of RECENT list
     
    3938 S X=$P(DATA,U) D PARAMS^MAGJLS2B(X)
    4039 I 'LSTID S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Problem with Exams List Compile--"_DATA_"." Q
    41  I MAGJOB("P32"),+$G(MAGJOB("P32STOP")) S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~VistARad Patch 32 is no longer supported.  Contact Imaging support for the current version of the VistARad client software." Q  ; <*>
    4240 I BKGND,LSTREQ="U" D BKREQU Q  ; UNREAD in bkgnd
    4341 I BKGND,LSTREQ="R" D BKREQR Q  ; RECENT in bkgnd
     
    8987 I +$G(COMPFAIL) S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Unable to Compile Unread Exams list"
    9088 E  D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^XTMP("MAGJ2",LSTNAM,LSTNUM)),LSTAGE)
    91  K LSTAGE
    9289 Q
    9390 ;
     
    10097 I 'LSTNUM S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Problem with "_LSTNM_" List Compile program (age="_LSTAGE_" for "_LSTNAM_")"_$S(LSTNAM["9992":"--May need to Schedule RECENT List Compile in TaskMan.",1:"")
    10198 E  D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^XTMP("MAGJ2",LSTNAM,LSTNUM)),LSTAGE)
    102  K LSTAGE
    10399 Q
    104100 ;
     
    117113 . D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^TMP($J,"MAGJ")))
    118114 I 'ALLGO S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Problem with ALL Exams List Compile "_DATA_". "_REPLY
    119  K LSTAGE
    120115 Q
    121116 ;
     
    151146 D LSTCOMP()
    152147 I LSTREQ="R" D NEWINT
    153  I LSTREQ="U" D UPDR^MAGJLS2B G BKLOOP  ;UNREAD loops; RECENT uses TaskMan
     148 I LSTREQ="U" D UPDR G BKLOOP  ;UNREAD loops; RECENT uses TaskMan
    154149BKGNDZ I LSTREQ="U" L -^XTMP("MAGJ2","BKGND2","RUN")
    155150 N ZTREQ S ZTREQ="@"  ;  clean up task entry
    156  K BKLOOP,DELTA,LSTAGE
     151 K BKLOOP,DELTA
    157152 Q  ; Exit bkgnd
    158153 ;
    159 NEWINT ; Add exams newly Interp since Recent Compile started to Recent List
    160  ; 1st, get list of candidates:
     154UPDR ; Add Newly Interp exams to Recent
     155 D PARAMS^MAGJLS2B(9995)
     156 I 'LSTID G UPDRZ
     157 S X=$$CURLIST(LSTNAM),LSTAGE=$P(X,U,2),LSTNUM=+X
     158 D LSTCOMP()
     159UPDRZ Q  ;
     160 ;
     161NEWINT ; Exams newly Interp since Recent Compile started
     162 ; are added to Recent List (add to "RECENT" index)
     163 ; 1st, get list of all potential candidates:
    161164 N INDX L +^XTMP("MAGJ2","RECENT"):15
    162165 E  Q
    163166 S INDX=+$G(^TMP($J,"NEWINT")) ; counter when Recent Compile started
    164167 I INDX S INDX=INDX-1 F  S INDX=$O(^XTMP("MAGJ2","RECENT",INDX)) Q:'INDX  S X=^(INDX) I X S ^TMP($J,"NEWINT",0,INDX)=X
    165  K ^XTMP("MAGJ2","RECENT") S ^("RECENT",0)=0
     168 K ^XTMP("MAGJ2","RECENT") S ^("RECENT",0)=0 ; init this index
    166169 L -^XTMP("MAGJ2","RECENT")
    167  ;if not in Recent Compile, add to index
     170 ;find those not included in Recent Compile, and add to index
    168171 S INDX=""
    169172 F  S INDX=$O(^TMP($J,"NEWINT",0,INDX)) Q:'INDX  S X=^(INDX) D
    170  . I $D(^TMP($J,"NEWINT",$P(X,U,1,3))) Q  ; already there
     173 . I $D(^TMP($J,"NEWINT",$P(X,U,1,3))) Q  ; already in the compile
    171174 . L +^XTMP("MAGJ2","RECENT"):15
    172175 . E  Q
    173  . S I=+$G(^XTMP("MAGJ2","RECENT",0))+1,$P(^(0),U)=I,^(I)=X ;add
     176 . S I=+$G(^XTMP("MAGJ2","RECENT",0))+1,$P(^(0),U)=I,^(I)=X ; add to indx
    174177 . L -^XTMP("MAGJ2","RECENT")
    175178 K ^TMP($J,"NEWINT")
     
    178181LSTCOMP(COMPFAIL) ; Compile new list; subrtn used by Active and Bkgnd tags
    179182 S COMPFAIL=0 ; Return T/F for "Executed a List Compile?"
    180  L +^XTMP("MAGJ2","BKGND",LSTNAM,"COMPILE"):60
     183 L +^XTMP("MAGJ2","BKGND",LSTNAM,"COMPILE"):60 ; shouldn't need any time
    181184 E  S COMPFAIL=1 G LSTCOMZ
    182  S NEWLIST=$S(LSTNUM=1:2,1:1) ; toggle node to use
     185 S NEWLIST=$S(LSTNUM=1:2,1:1) ; toggle node to use for new compile
    183186 N TS,COMTIM
    184  S TS="" F I=2,0 S TS=TS_$S(TS="":"",1:U)_$$HTFM^XLFDT($H+I,0)
     187 S TS="" F I=2,0 S %H=$H+I D YMD^%DTC S TS=TS_$S(TS="":"",1:U)_X
    185188 S ^XTMP("MAGJ2",0)=TS_U_"VistaRad List Compile"
    186189 S ^XTMP("MAGJ2",0,LSTNAM,NEWLIST)=$H
     
    194197LSTCOMZ L -^XTMP("MAGJ2","BKGND",LSTNAM,"COMPILE")
    195198 Q  ;
    196 CURLIST(LSTNAM,WAIT) ; return cur. list & age in secs
     199 ;
     200CURLIST(LSTNAM,WAIT) ; return current list & its age in seconds
     201 ;
    197202 S WAIT=+$G(WAIT)
    198203 N X,RET,AGE,TRY,START,EXTRATIM
     
    204209CURLISZ Q RET
    205210 ;
    206 DELTA(X,Y) ; calc # secs bet 2 $h values; dflt 2nd value = now
     211DELTA(X,Y) ; calc # seconds between 2 $h values; default 2nd value = now
    207212 ; useful limit is one day
    208213 I $G(Y)="" S Y=$H
    209214 I +Y=+X
    210215 E  D
    211  . I Y-X=1 S $P(Y,",",2)=86400+$P(Y,",",2)  ; midnight boundary
    212  . E  S $P(X,",",2)=0,$P(Y,",",2)=86400  ; > one day
     216 . I Y-X=1 S $P(Y,",",2)=86400+$P(Y,",",2)  ; cross midnight boundary
     217 . E  S $P(X,",",2)=0,$P(Y,",",2)=86400  ; more than one day
    213218 Q ($P(Y,",",2)-$P(X,",",2))
    214219 ;
Note: See TracChangeset for help on using the changeset viewer.