RGMTRUN ;BIR/CML,PTD-SCAN TASKMAN RUNNING HL7 TASKS ;07/12/00
;;1.0;CLINCAL INFO RESOURCE NETWORK;**25,20**;30 Apr 99
;
;Reference to ^%ZTSCH("TASK" supported by IA #3520
;Reference to EN^XUTMTP supported by IA #3521
;Setting ZT* and XU* variables supported by IA #3521
;
MAIN ;Entry point for device call
W !!,"This option prints the currently running HL7 tasks."
W !,"The right margin for this report is 80.",!
S NOTRPC=1
K ZTSAVE S ZTSAVE("NOTRPC")=""
D EN^XUTMDEVQ("START^RGMTRUN","Print Running HL7 Task Data") I 'POP K NOTRPC Q
W !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
K NOTRPC
Q
;
START ;Entry point for RPC call
S $P(LN,"-",80)="",CNT=0,QFLG=0
I $D(NOTRPC) W @IOF,!
I '$D(NOTRPC) W "Running HL7 Tasks at "_$P($$SITE^VASITE(),"^",2)_":"
I '$D(NOTRPC) D NOW^%DTC W !,"Date compiled: ",$$FMTE^XLFDT($E(%,1,12))
;
S TASK=0 F S TASK=$O(^%ZTSCH("TASK",TASK)) Q:'TASK Q:QFLG D
.S ROU=$P(^%ZTSCH("TASK",TASK),"^",2)
.I (ROU["HL")!(ROU["RG") D
..S CNT=CNT+1
..N ZTENV,ZTKEY,ZTFLAG,ZTNAME,XUTMUCI
..S ZTENV=1,ZTKEY=0,ZTFLAG=1,ZTNAME=$$GET1^DIQ(200,+DUZ_",",.01)
..X ^%ZOSF("UCI") S XUTMUCI=Y
..D EN^XUTMTP(TASK) W !,LN
..I $D(NOTRPC),CNT=5 W ! S DIR(0)="E" D ^DIR K DIR S CNT=0 S:'Y QFLG=1 I Y W @IOF
;
QUIT ;Kill variables and quit.
I $D(NOTRPC) W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
K %,CNT,LN,NOTRPC,QFLG,ROU,TASK,Y,ZTSK
Q
;
;
TASK(RETURN) ;Remote HL7 task display
N ARRAY
S ARRAY="^TMP(""RGMTHFS"","_$J_")"
D HFS^RGMTHFS("START^RGMTRUN")
M RETURN=^TMP("RGMTHFS",$J)
K ^TMP("RGMTHFS",$J)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGMTRUN 1606 printed Dec 13, 2024@01:42:27 Page 2
RGMTRUN ;BIR/CML,PTD-SCAN TASKMAN RUNNING HL7 TASKS ;07/12/00
+1 ;;1.0;CLINCAL INFO RESOURCE NETWORK;**25,20**;30 Apr 99
+2 ;
+3 ;Reference to ^%ZTSCH("TASK" supported by IA #3520
+4 ;Reference to EN^XUTMTP supported by IA #3521
+5 ;Setting ZT* and XU* variables supported by IA #3521
+6 ;
MAIN ;Entry point for device call
+1 WRITE !!,"This option prints the currently running HL7 tasks."
+2 WRITE !,"The right margin for this report is 80.",!
+3 SET NOTRPC=1
+4 KILL ZTSAVE
SET ZTSAVE("NOTRPC")=""
+5 DO EN^XUTMDEVQ("START^RGMTRUN","Print Running HL7 Task Data")
IF 'POP
KILL NOTRPC
QUIT
+6 WRITE !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
+7 KILL NOTRPC
+8 QUIT
+9 ;
START ;Entry point for RPC call
+1 SET $PIECE(LN,"-",80)=""
SET CNT=0
SET QFLG=0
+2 IF $DATA(NOTRPC)
WRITE @IOF,!
+3 IF '$DATA(NOTRPC)
WRITE "Running HL7 Tasks at "_$PIECE($$SITE^VASITE(),"^",2)_":"
+4 IF '$DATA(NOTRPC)
DO NOW^%DTC
WRITE !,"Date compiled: ",$$FMTE^XLFDT($EXTRACT(%,1,12))
+5 ;
+6 SET TASK=0
FOR
SET TASK=$ORDER(^%ZTSCH("TASK",TASK))
if 'TASK
QUIT
if QFLG
QUIT
Begin DoDot:1
+7 SET ROU=$PIECE(^%ZTSCH("TASK",TASK),"^",2)
+8 IF (ROU["HL")!(ROU["RG")
Begin DoDot:2
+9 SET CNT=CNT+1
+10 NEW ZTENV,ZTKEY,ZTFLAG,ZTNAME,XUTMUCI
+11 SET ZTENV=1
SET ZTKEY=0
SET ZTFLAG=1
SET ZTNAME=$$GET1^DIQ(200,+DUZ_",",.01)
+12 XECUTE ^%ZOSF("UCI")
SET XUTMUCI=Y
+13 DO EN^XUTMTP(TASK)
WRITE !,LN
+14 IF $DATA(NOTRPC)
IF CNT=5
WRITE !
SET DIR(0)="E"
DO ^DIR
KILL DIR
SET CNT=0
if 'Y
SET QFLG=1
IF Y
WRITE @IOF
End DoDot:2
End DoDot:1
+15 ;
QUIT ;Kill variables and quit.
+1 IF $DATA(NOTRPC)
if $EXTRACT(IOST)'="C"
WRITE @IOF
DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 KILL %,CNT,LN,NOTRPC,QFLG,ROU,TASK,Y,ZTSK
+3 QUIT
+4 ;
+5 ;
TASK(RETURN) ;Remote HL7 task display
+1 NEW ARRAY
+2 SET ARRAY="^TMP(""RGMTHFS"","_$JOB_")"
+3 DO HFS^RGMTHFS("START^RGMTRUN")
+4 MERGE RETURN=^TMP("RGMTHFS",$JOB)
+5 KILL ^TMP("RGMTHFS",$JOB)
+6 QUIT
+7 ;