Changeset 636 for FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGJLS2.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGJLS2.m
r628 r636 1 1 MAGJLS2 ;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 4 3 ;; +---------------------------------------------------------------+ 5 4 ;; | Property of the US Government. | … … 19 18 Q 20 19 ; ACTIVE -- list exams (Unread, Recent, &/or Pending) for input Imaging Type(s) 21 ; RPC Call: MAGJ RADACTIVEEXAMS20 ; RPC Call: MAGJ RADACTIVEEXAMS 22 21 ; BKGND -- EP for Bkgnd Compile of UNREAD list 23 22 ; BKGND2 -- EP for Bkgnd Compile of RECENT list … … 39 38 S X=$P(DATA,U) D PARAMS^MAGJLS2B(X) 40 39 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 ; <*>42 40 I BKGND,LSTREQ="U" D BKREQU Q ; UNREAD in bkgnd 43 41 I BKGND,LSTREQ="R" D BKREQR Q ; RECENT in bkgnd … … 89 87 I +$G(COMPFAIL) S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Unable to Compile Unread Exams list" 90 88 E D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^XTMP("MAGJ2",LSTNAM,LSTNUM)),LSTAGE) 91 K LSTAGE92 89 Q 93 90 ; … … 100 97 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:"") 101 98 E D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^XTMP("MAGJ2",LSTNAM,LSTNUM)),LSTAGE) 102 K LSTAGE103 99 Q 104 100 ; … … 117 113 . D LSTOUT^MAGJLS2B(.MAGGRY,LSTID,$NA(^TMP($J,"MAGJ"))) 118 114 I 'ALLGO S MAGGRY=$NA(^TMP($J,"RET")),@MAGGRY@(0)="0^4~Problem with ALL Exams List Compile "_DATA_". "_REPLY 119 K LSTAGE120 115 Q 121 116 ; … … 151 146 D LSTCOMP() 152 147 I LSTREQ="R" D NEWINT 153 I LSTREQ="U" D UPDR ^MAGJLS2BG BKLOOP ;UNREAD loops; RECENT uses TaskMan148 I LSTREQ="U" D UPDR G BKLOOP ;UNREAD loops; RECENT uses TaskMan 154 149 BKGNDZ I LSTREQ="U" L -^XTMP("MAGJ2","BKGND2","RUN") 155 150 N ZTREQ S ZTREQ="@" ; clean up task entry 156 K BKLOOP,DELTA ,LSTAGE151 K BKLOOP,DELTA 157 152 Q ; Exit bkgnd 158 153 ; 159 NEWINT ; Add exams newly Interp since Recent Compile started to Recent List 160 ; 1st, get list of candidates: 154 UPDR ; 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() 159 UPDRZ Q ; 160 ; 161 NEWINT ; 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: 161 164 N INDX L +^XTMP("MAGJ2","RECENT"):15 162 165 E Q 163 166 S INDX=+$G(^TMP($J,"NEWINT")) ; counter when Recent Compile started 164 167 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 166 169 L -^XTMP("MAGJ2","RECENT") 167 ; if not in Recent Compile,add to index170 ;find those not included in Recent Compile, and add to index 168 171 S INDX="" 169 172 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 there173 . I $D(^TMP($J,"NEWINT",$P(X,U,1,3))) Q ; already in the compile 171 174 . L +^XTMP("MAGJ2","RECENT"):15 172 175 . E Q 173 . S I=+$G(^XTMP("MAGJ2","RECENT",0))+1,$P(^(0),U)=I,^(I)=X ; add176 . S I=+$G(^XTMP("MAGJ2","RECENT",0))+1,$P(^(0),U)=I,^(I)=X ; add to indx 174 177 . L -^XTMP("MAGJ2","RECENT") 175 178 K ^TMP($J,"NEWINT") … … 178 181 LSTCOMP(COMPFAIL) ; Compile new list; subrtn used by Active and Bkgnd tags 179 182 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 181 184 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 183 186 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 185 188 S ^XTMP("MAGJ2",0)=TS_U_"VistaRad List Compile" 186 189 S ^XTMP("MAGJ2",0,LSTNAM,NEWLIST)=$H … … 194 197 LSTCOMZ L -^XTMP("MAGJ2","BKGND",LSTNAM,"COMPILE") 195 198 Q ; 196 CURLIST(LSTNAM,WAIT) ; return cur. list & age in secs 199 ; 200 CURLIST(LSTNAM,WAIT) ; return current list & its age in seconds 201 ; 197 202 S WAIT=+$G(WAIT) 198 203 N X,RET,AGE,TRY,START,EXTRATIM … … 204 209 CURLISZ Q RET 205 210 ; 206 DELTA(X,Y) ; calc # sec s bet 2 $h values; dflt 2nd value = now211 DELTA(X,Y) ; calc # seconds between 2 $h values; default 2nd value = now 207 212 ; useful limit is one day 208 213 I $G(Y)="" S Y=$H 209 214 I +Y=+X 210 215 E D 211 . I Y-X=1 S $P(Y,",",2)=86400+$P(Y,",",2) ; midnight boundary212 . E S $P(X,",",2)=0,$P(Y,",",2)=86400 ; >one day216 . 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 213 218 Q ($P(Y,",",2)-$P(X,",",2)) 214 219 ;
Note:
See TracChangeset
for help on using the changeset viewer.