MAGQE4 ;WOIFO/RMP - Support for MAG Enterprise ; 05/06/2004 06:32
;;3.0;IMAGING;**27,29,30,78**;May 9, 2006
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;
TASK ;Re-task the job
N DA,DIE,DR,I,MAGTSK,X,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
; First clean up any entries that might already be there
D RTN^%ZTLOAD("ISU^MAGQE2","MAGTSK")
; EdM: Note: The above procedure only returns tasks submitted
; with the DUZ of the current requestor, unless...:
; When $D(^XUSEC("ZTMQ",DUZ))>0,
; tasks with other DUZs are reported as well.
S I=0 F S I=$O(MAGTSK(I)) Q:'I D
. N ZTSK
. S ZTSK=I D KILL^%ZTLOAD
. Q
; Then queue up the next report for 2nd day of the next month
S ZTDTH=$$NOW^XLFDT()\100+1 S:(ZTDTH#100)>12 ZTDTH=ZTDTH+88
S ZTDTH=ZTDTH_"01.040101"
S ZTRTN="ISU^MAGQE2",ZTDESC="Site Imaging Utilization report",ZTIO=""
S:$D(MAGDUZ) ZTSAVE("MAGDUZ")=MAGDUZ
D ^%ZTLOAD
; Record the task number in the Site Parameter Table
S DA=$S($T(PLACE^MAGBAPI)'="":$$PLACE^MAGBAPI($$MAGDUZ2^MAGQE5()),1:1)
S DIE="^MAG(2006.1,",DR="10///^S X=ZTSK" D ^DIE
Q
;
STTASK ; Start the Imaging task report
N DAYS,MAGDUZ,MCON,REC,TASK,ZTSK
S REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5()) Q:'$D(^MAG(2006.1,REC))
S TASK=$P($G(^MAG(2006.1,REC,1)),"^",7)
I TASK'="" D Q:TASK'=""
. S ZTSK=TASK D STAT^%ZTLOAD
. I ZTSK(0)=0 S TASK=""
. E W:$G(XQY0)["MAG" !,"Task is already running"
. Q
S MCON="",MAGDUZ=DUZ,DAYS=1
D RESTASK ; Also called from elsewhere
Q
;
RESTASK ; Restart the Imaging task report
N DA,DIC,DIE,DR,ZTDESC,ZTIO,ZTRTN,ZTSAVE
S ZTRTN="ISU^MAGQE2",ZTDESC="Site Imaging Utilization report",ZTIO=""
S:$D(MAGDUZ) ZTSAVE("MAGDUZ")=MAGDUZ
S ZTDTH=$$NOW^XLFDT()\100+1 S:(ZTDTH#100)>12 ZTDTH=ZTDTH+88
S ZTDTH=ZTDTH_"01.040101"
D ^%ZTLOAD
S DIE="^MAG(2006.1,",DA=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5()),DR="10///^S X=ZTSK" D ^DIE
W:$G(XQY0)["MAG" !,"Task is started. To remove task execute option MAGREPSTOP"
K MCDUZ
Q
;
REMTASK ;Remove the Imaging Task Report
N DA,DIE,DR,FIND,REC,TASK,ZTSK
S REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5())
S TASK=$P($G(^MAG(2006.1,REC,1)),"^",7)
I TASK D Q
. S DIE="^MAG(2006.1,",DA=REC,DR="10///@" D ^DIE
. S ZTSK=TASK D KILL^%ZTLOAD
. Q:$G(XQY0)'["MAG"
. I ZTSK(0)=1 W !,"Task is removed. To restart execute option MAGREPSTART"
. E W !,"Could not stop task or task was no longer active."
. Q
I $G(XQY0)["MAG" W !,"No task to stop."
Q
;
UPPER(X) ;
Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGQE4 3514 printed Oct 16, 2024@18:08:45 Page 2
MAGQE4 ;WOIFO/RMP - Support for MAG Enterprise ; 05/06/2004 06:32
+1 ;;3.0;IMAGING;**27,29,30,78**;May 9, 2006
+2 ;; +---------------------------------------------------------------+
+3 ;; | Property of the US Government. |
+4 ;; | No permission to copy or redistribute this software is given. |
+5 ;; | Use of unreleased versions of this software requires the user |
+6 ;; | to execute a written test agreement with the VistA Imaging |
+7 ;; | Development Office of the Department of Veterans Affairs, |
+8 ;; | telephone (301) 734-0100. |
+9 ;; | |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
TASK ;Re-task the job
+1 NEW DA,DIE,DR,I,MAGTSK,X,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
+2 ; First clean up any entries that might already be there
+3 DO RTN^%ZTLOAD("ISU^MAGQE2","MAGTSK")
+4 ; EdM: Note: The above procedure only returns tasks submitted
+5 ; with the DUZ of the current requestor, unless...:
+6 ; When $D(^XUSEC("ZTMQ",DUZ))>0,
+7 ; tasks with other DUZs are reported as well.
+8 SET I=0
FOR
SET I=$ORDER(MAGTSK(I))
if 'I
QUIT
Begin DoDot:1
+9 NEW ZTSK
+10 SET ZTSK=I
DO KILL^%ZTLOAD
+11 QUIT
End DoDot:1
+12 ; Then queue up the next report for 2nd day of the next month
+13 SET ZTDTH=$$NOW^XLFDT()\100+1
if (ZTDTH#100)>12
SET ZTDTH=ZTDTH+88
+14 SET ZTDTH=ZTDTH_"01.040101"
+15 SET ZTRTN="ISU^MAGQE2"
SET ZTDESC="Site Imaging Utilization report"
SET ZTIO=""
+16 if $DATA(MAGDUZ)
SET ZTSAVE("MAGDUZ")=MAGDUZ
+17 DO ^%ZTLOAD
+18 ; Record the task number in the Site Parameter Table
+19 SET DA=$SELECT($TEXT(PLACE^MAGBAPI)'="":$$PLACE^MAGBAPI($$MAGDUZ2^MAGQE5()),1:1)
+20 SET DIE="^MAG(2006.1,"
SET DR="10///^S X=ZTSK"
DO ^DIE
+21 QUIT
+22 ;
STTASK ; Start the Imaging task report
+1 NEW DAYS,MAGDUZ,MCON,REC,TASK,ZTSK
+2 SET REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5())
if '$DATA(^MAG(2006.1,REC))
QUIT
+3 SET TASK=$PIECE($GET(^MAG(2006.1,REC,1)),"^",7)
+4 IF TASK'=""
Begin DoDot:1
+5 SET ZTSK=TASK
DO STAT^%ZTLOAD
+6 IF ZTSK(0)=0
SET TASK=""
+7 IF '$TEST
if $GET(XQY0)["MAG"
WRITE !,"Task is already running"
+8 QUIT
End DoDot:1
if TASK'=""
QUIT
+9 SET MCON=""
SET MAGDUZ=DUZ
SET DAYS=1
+10 ; Also called from elsewhere
DO RESTASK
+11 QUIT
+12 ;
RESTASK ; Restart the Imaging task report
+1 NEW DA,DIC,DIE,DR,ZTDESC,ZTIO,ZTRTN,ZTSAVE
+2 SET ZTRTN="ISU^MAGQE2"
SET ZTDESC="Site Imaging Utilization report"
SET ZTIO=""
+3 if $DATA(MAGDUZ)
SET ZTSAVE("MAGDUZ")=MAGDUZ
+4 SET ZTDTH=$$NOW^XLFDT()\100+1
if (ZTDTH#100)>12
SET ZTDTH=ZTDTH+88
+5 SET ZTDTH=ZTDTH_"01.040101"
+6 DO ^%ZTLOAD
+7 SET DIE="^MAG(2006.1,"
SET DA=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5())
SET DR="10///^S X=ZTSK"
DO ^DIE
+8 if $GET(XQY0)["MAG"
WRITE !,"Task is started. To remove task execute option MAGREPSTOP"
+9 KILL MCDUZ
+10 QUIT
+11 ;
REMTASK ;Remove the Imaging Task Report
+1 NEW DA,DIE,DR,FIND,REC,TASK,ZTSK
+2 SET REC=$$PLACE^MAGQE5($$MAGDUZ2^MAGQE5())
+3 SET TASK=$PIECE($GET(^MAG(2006.1,REC,1)),"^",7)
+4 IF TASK
Begin DoDot:1
+5 SET DIE="^MAG(2006.1,"
SET DA=REC
SET DR="10///@"
DO ^DIE
+6 SET ZTSK=TASK
DO KILL^%ZTLOAD
+7 if $GET(XQY0)'["MAG"
QUIT
+8 IF ZTSK(0)=1
WRITE !,"Task is removed. To restart execute option MAGREPSTART"
+9 IF '$TEST
WRITE !,"Could not stop task or task was no longer active."
+10 QUIT
End DoDot:1
QUIT
+11 IF $GET(XQY0)["MAG"
WRITE !,"No task to stop."
+12 QUIT
+13 ;
UPPER(X) ;
+1 QUIT $TRANSLATE(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+2 ;