source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGQE4.m@ 837

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1MAGQE4 ;WOIFO/RMP - Support for MAG Enterprise ; 05/06/2004 06:32
2 ;;3.0;IMAGING;**27,29,30,78**;May 9, 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 medical device. As such, it may not be changed in any way. |
13 ;; | Modifications to this software may result in an adulterated |
14 ;; | medical device under 21CFR820, the use of which is considered |
15 ;; | to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 Q
19 ;
20TASK ;Re-task the job
21 N DA,DIE,DR,I,MAGTSK,X,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
22 ; First clean up any entries that might already be there
23 D RTN^%ZTLOAD("ISU^MAGQE2","MAGTSK")
24 ; EdM: Note: The above procedure only returns tasks submitted
25 ; with the DUZ of the current requestor, unless...:
26 ; When $D(^XUSEC("ZTMQ",DUZ))>0,
27 ; tasks with other DUZs are reported as well.
28 S I=0 F S I=$O(MAGTSK(I)) Q:'I D
29 . N ZTSK
30 . S ZTSK=I D KILL^%ZTLOAD
31 . Q
32 ; Then queue up the next report for 2nd day of the next month
33 S ZTDTH=$$NOW^XLFDT()\100+1 S:(ZTDTH#100)>12 ZTDTH=ZTDTH+88
34 S ZTDTH=ZTDTH_"01.040101"
35 S ZTRTN="ISU^MAGQE2",ZTDESC="Site Imaging Utilization report",ZTIO=""
36 S:$D(MAGDUZ) ZTSAVE("MAGDUZ")=MAGDUZ
37 D ^%ZTLOAD
38 ; Record the task number in the Site Parameter Table
39 S DA=$S($T(PLACE^MAGBAPI)'="":$$PLACE^MAGBAPI($$MAGDUZ2^MAGQE5()),1:1)
40 S DIE="^MAG(2006.1,",DR="10///^S X=ZTSK" D ^DIE
41 Q
42 ;
43STTASK ; Start the Imaging task report
44 N DAYS,MAGDUZ,MCON,REC,TASK,ZTSK
45 S REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5()) Q:'$D(^MAG(2006.1,REC))
46 S TASK=$P($G(^MAG(2006.1,REC,1)),"^",7)
47 I TASK'="" D Q:TASK'=""
48 . S ZTSK=TASK D STAT^%ZTLOAD
49 . I ZTSK(0)=0 S TASK=""
50 . E W:$G(XQY0)["MAG" !,"Task is already running"
51 . Q
52 S MCON="",MAGDUZ=DUZ,DAYS=1
53 D RESTASK ; Also called from elsewhere
54 Q
55 ;
56RESTASK ; Restart the Imaging task report
57 N DA,DIC,DIE,DR,ZTDESC,ZTIO,ZTRTN,ZTSAVE
58 S ZTRTN="ISU^MAGQE2",ZTDESC="Site Imaging Utilization report",ZTIO=""
59 S:$D(MAGDUZ) ZTSAVE("MAGDUZ")=MAGDUZ
60 S ZTDTH=$$NOW^XLFDT()\100+1 S:(ZTDTH#100)>12 ZTDTH=ZTDTH+88
61 S ZTDTH=ZTDTH_"01.040101"
62 D ^%ZTLOAD
63 S DIE="^MAG(2006.1,",DA=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5()),DR="10///^S X=ZTSK" D ^DIE
64 W:$G(XQY0)["MAG" !,"Task is started. To remove task execute option MAGREPSTOP"
65 K MCDUZ
66 Q
67 ;
68REMTASK ;Remove the Imaging Task Report
69 N DA,DIE,DR,FIND,REC,TASK,ZTSK
70 S REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5())
71 S TASK=$P($G(^MAG(2006.1,REC,1)),"^",7)
72 I TASK D Q
73 . S DIE="^MAG(2006.1,",DA=REC,DR="10///@" D ^DIE
74 . S ZTSK=TASK D KILL^%ZTLOAD
75 . Q:$G(XQY0)'["MAG"
76 . I ZTSK(0)=1 W !,"Task is removed. To restart execute option MAGREPSTART"
77 . E W !,"Could not stop task or task was no longer active."
78 . Q
79 I $G(XQY0)["MAG" W !,"No task to stop."
80 Q
81 ;
82UPPER(X) ;
83 Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
84 ;
Note: See TracBrowser for help on using the repository browser.