source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGQBJHR.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1MAGQBJHR ;WOIFO/RP; Report of Currently Queued items [ 03/28/2001 18:40 ]
2 ;;3.0;IMAGING;**20**;Apr 12, 2006
3 ;; +---------------------------------------------------------------+
4 ;; | Property of the US Government. |
5 ;; | No permission to copy or redistribute this software is given. |
6 ;; | Use of unreleased versions of this software requires the user |
7 ;; | to execute a written test agreement with the VistA Imaging |
8 ;; | Development Office of the Department of Veterans Affairs, |
9 ;; | telephone (301) 734-0100. |
10 ;; | |
11 ;; | The Food and Drug Administration classifies this software as |
12 ;; | a Class II medical device. As such, it may not be changed |
13 ;; | in any way. Modifications to this software may result in an |
14 ;; | adulterated medical device under 21CFR820, the use of which |
15 ;; | is considered to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 ;Report of currently queued JBTOHD
19JHRPT(RESULT) ;[MAGQ JH RPT]
20 N INDEX,CNT,TYPE,SUBTYPE,PDUZ,PAT,IEN,QUEUER,SESS,PLACE
21 S TYPE="JBTOHD",CNT=-1,PLACE=$$PLACE^MAGBAPI(+$G(DUZ(2)))
22 ;S INDEX=550
23 S INDEX=$P($G(^MAGQUEUE(2006.031,$O(^MAGQUEUE(2006.031,"C",PLACE,TYPE,0)),0)),"^",2)
24 D SL("Current JBTOHD queue: "_INDEX_" "_$P($G(^MAGQUEUE(2006.03,INDEX,0)),"^",4),2)
25 F S INDEX=$O(^MAGQUEUE(2006.03,"C",PLACE,TYPE,INDEX)) Q:INDEX'?1N.N D
26 . S NODE=$G(^MAGQUEUE(2006.03,INDEX,0))
27 . Q:NODE=""
28 . S SUBTYPE=$P(NODE,"^",8),PDUZ=+$P(NODE,"^",2),IEN=$P(NODE,"^",7)
29 . S PAT=+$P($G(^MAG(2005,IEN,0)),"^",7)
30 . S:'$D(^TMP("MAGQJDE",$J,PDUZ,0,PAT,0)) ^TMP("MAGQJDE",$J,PDUZ,0,PAT,0)=INDEX
31 . S ^TMP("MAGQJDE",$J,PDUZ,0,PAT)=+$G(^TMP("MAGQJDE",$J,PDUZ,0,PAT))+1
32 . S ^TMP("MAGQJDE",$J,PDUZ,0)=+$G(^TMP("MAGQJDE",$J,PDUZ,0))+1
33 . S ^TMP("MAGQJDE",$J,PDUZ,SUBTYPE)=+$G(^TMP("MAGQJDE",$J,PDUZ,SUBTYPE))+1
34 ;Reporting
35 S INDEX=""
36 N TITLE
37 F S INDEX=$O(^TMP("MAGQJDE",$J,INDEX)) Q:INDEX'?1N.N D
38 . S QUEUER=$$GET1^DIQ(200,INDEX,.01)
39 . Q:QUEUER=""
40 . D SL("Image Queuer: "_QUEUER,2)
41 . S TITLE=$$GET1^DIQ(200,INDEX,20.3)
42 . S:TITLE="" TITLE=$$GET1^DIQ(200,INDEX,8)
43 . D SL(" "_TITLE_"-"_$$GET1^DIQ(200,INDEX,29),1)
44 . D SL(" "_"Number of Queues: "_^TMP("MAGQJDE",$J,INDEX,0),1)
45 . D SESS(QUEUER,.SESS)
46 . N INDX S INDX=""
47 . F S INDX=$O(SESS(INDX)) Q:INDX'?1N.N D
48 . . D SL(" Today's WS logins: "_$P(SESS(INDX),"^")_" Display Version: "_$P(SESS(INDX),"^",2),1)
49 . S INDX=$O(^MAG(2006.19,"AC",INDEX,""))
50 . I INDX?1N.N D SL(" Queuer's View of Jukebox images: "_$S($P(^MAG(2006.19,INDX,0),"^",6)=1:"true",1:"false"),1)
51 . D SUBT(INDEX)
52 . D PATIN(INDEX)
53 . D SL(" ",1)
54 K ^TMP("MAGQJDE")
55 Q
56SL(LINE,CR) ;
57 S CNT=CNT+1
58 S RESULT(CNT)=LINE
59 Q
60SESS(ID,SESS) ;
61 N INDX,NODE,TODAY,DONE,WS,WSNODE
62 K SESS
63 S INDX=" ",DONE=0
64 D NOW^%DTC S TODAY=$P(%,".")
65 F S INDX=$O(^MAG(2006.82,"B",+ID,INDX),-1) Q:INDX'?1N.N D Q:DONE
66 . S NODE=$G(^MAG(2006.82,INDX,0))
67 . I $P($P(NODE,"^",3),".")<TODAY S DONE=1 Q
68 . S WS=$P(NODE,"^",5)
69 . S WSNODE=$G(^MAG(2006.81,WS,0))
70 . S SESS(WS)=$P(WSNODE,"^")_"^"_$P(WSNODE,"^",9)
71 Q
72PATIN(MD) ;
73 N PID
74 S PID=0
75 F S PID=$O(^TMP("MAGQJDE",$J,MD,0,PID)) Q:PID'?1N.N D
76 . D SL(" Patient: "_$P($G(^DPT(PID,0)),"^")_" - "_$G(^TMP("MAGQJDE",$J,MD,0,PID,0)),1)
77 Q
78SUBT(MD) ;
79 N SUBTYPE
80 S SUBTYPE=0
81 F S SUBTYPE=$O(^TMP("MAGQJDE",$J,MD,SUBTYPE)) Q:SUBTYPE="" D
82 . D SL(" Number of "_SUBTYPE_" : "_^TMP("MAGQJDE",$J,MD,SUBTYPE),1)
83 Q
Note: See TracBrowser for help on using the repository browser.