CIAUTSK ;MSC/IND/DKM - Encapsulates TaskMan API ;04-May-2006 08:19;DKM
;;1.2;CIA UTILITIES;;Mar 20, 2007
;;Copyright 2000-2006, Medsphere Systems Corporation
;=================================================================
QUEUE(ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTIO,ZTUCI,ZTPRI) ;
N %CIAZ,%CIAZ1,%CIAZ2,ZTKIL,ZTSK,ZTCPU
S:'$G(ZTDTH) ZTDTH=$H
S:ZTDTH'?1.N1","1.N ZTDTH=$$FMTH^XLFDT(ZTDTH)
Q:ZTDTH<0 0
S:$G(ZTUCI)'="" ZTUCI=$TR(ZTUCI,":",","),ZTCPU=$P(ZTUCI,",",2),ZTUCI=$P(ZTUCI,",")
S ZTSAVE=$G(ZTSAVE),ZTIO=$G(ZTIO),U="^"
F %CIAZ=1:1:$L(ZTSAVE,U) D
.S %CIAZ1=$P(ZTSAVE,U,%CIAZ),%CIAZ2=$P(%CIAZ1,"=",2,999),%CIAZ1=$P(%CIAZ1,"=")
.S:%CIAZ1'="" ZTSAVE(%CIAZ1)=%CIAZ2
D ^%ZTLOAD
Q +$G(ZTSK)
CIAUTSK ;MSC/IND/DKM - Encapsulates TaskMan API ;04-May-2006 08:19;DKM
+1 ;;1.2;CIA UTILITIES;;Mar 20, 2007
+2 ;;Copyright 2000-2006, Medsphere Systems Corporation
+3 ;=================================================================
QUEUE(ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTIO,ZTUCI,ZTPRI) ;
+1 NEW %CIAZ,%CIAZ1,%CIAZ2,ZTKIL,ZTSK,ZTCPU
+2 IF '$GET(ZTDTH)
SET ZTDTH=$HOROLOG
+3 IF ZTDTH'?1.N1","1.N
SET ZTDTH=$$FMTH^XLFDT(ZTDTH)
+4 IF ZTDTH<0
QUIT 0
+5 IF $GET(ZTUCI)'=""
SET ZTUCI=$TRANSLATE(ZTUCI,":",",")
SET ZTCPU=$PIECE(ZTUCI,",",2)
SET ZTUCI=$PIECE(ZTUCI,",")
+6 SET ZTSAVE=$GET(ZTSAVE)
SET ZTIO=$GET(ZTIO)
SET U="^"
+7 FOR %CIAZ=1:1:$LENGTH(ZTSAVE,U)
Begin DoDot:1
+8 SET %CIAZ1=$PIECE(ZTSAVE,U,%CIAZ)
SET %CIAZ2=$PIECE(%CIAZ1,"=",2,999)
SET %CIAZ1=$PIECE(%CIAZ1,"=")
+9 IF %CIAZ1'=""
SET ZTSAVE(%CIAZ1)=%CIAZ2
End DoDot:1
+10 DO ^%ZTLOAD
+11 QUIT +$GET(ZTSK)