RORTSK03 ;HCIOFO/SG - TASK MANAGER OVERFLOW CODE ; 8/30/05 8:34am
;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
;
Q
;
;***** PREPARE THE TASK PARAMETERS
;
; .PARAMS Reference to a local array that contains
; the task parameters
;
; Return Values:
; <0 Error code
; 0 Ok
;
PARAMS(PARAMS) ;
N I,NAME,NODE,SUBS,TMP
S I=""
F S I=$O(PARAMS(I)) Q:I="" D
. S NAME=$TR($P(PARAMS(I),"=")," ") Q:NAME=""
. S TMP=$P(NAME,"(") Q:TMP=""
. S NODE="RORTSK(""PARAMS"","""_TMP_""""
. S TMP=$P(NAME,"(",2,999)
. S NODE=$S(TMP'="":NODE_","_TMP,1:NODE_")")
. S @NODE=$$TRIM^XLFSTR($P(PARAMS(I),"=",2,999))
Q 0
;
;***** FORMATS THE TASK INFORMATION FOR $$TASKINFO^RORTSK02
;
; OFFSET Offset for the subscripts
; .INFO Reference to a local variable (output):
; IENS The second subscript in the RORBUF array
; .RORBUF Referrence to a local variable containing output
; of the GETS^DIQ procedure
; FLAGS Characters controlling behavior of the function
;
; Return Values:
; <0 Error code
; 0 Ok
;
FRMTI(OFFSET,INFO,IENS,RORBUF,FLAGS) ;
N I,TMP,ZTCPU,ZTSK
;--- Task Type
I $G(RORBUF(798.8,IENS,.02,"I"))'="" D
. S I=OFFSET+2,INFO(I)=RORBUF(798.8,IENS,.02,"I")
. S:FLAGS["E" $P(INFO(I),U,2)=$G(RORBUF(798.8,IENS,.02,"E"))
;--- Registry
I $G(RORBUF(798.8,IENS,.03,"I"))'="" D
. S I=OFFSET+3,INFO(I)=RORBUF(798.8,IENS,.03,"I")
. S:FLAGS["E" $P(INFO(I),U,2)=$G(RORBUF(798.8,IENS,.03,"E"))
;--- Report
S TMP=+$G(RORBUF(798.8,IENS,.04,"I"))
I TMP>0 S TMP=$$RPCODE^RORUTL08(TMP) I TMP'="" D
. S I=OFFSET+4,INFO(I)=TMP
. S:FLAGS["E" $P(INFO(I),U,2)=$G(RORBUF(798.8,IENS,.04,"E"))
;--- Description
S INFO(OFFSET+5)=$G(RORBUF(798.8,IENS,.05,"I"))
;--- Creation Time
I $G(RORBUF(798.8,IENS,.07,"I"))'="" D
. S INFO(OFFSET+7)=RORBUF(798.8,IENS,.07,"I")
;--- User
I $G(RORBUF(798.8,IENS,.08,"I"))'="" D
. S I=OFFSET+8,INFO(I)=RORBUF(798.8,IENS,.08,"I")
. S:FLAGS["E" $P(INFO(I),U,2)=$G(RORBUF(798.8,IENS,.08,"E"))
;--- Completion Time
I $G(RORBUF(798.8,IENS,2.02,"I"))'="" D
. S INFO(OFFSET+9)=RORBUF(798.8,IENS,2.02,"I")
;--- Progress Percentage
S TMP=$G(RORBUF(798.8,IENS,4,"I"))
S INFO(OFFSET+10)=$S(TMP'="":$J(TMP,0,2),1:"")
;--- Scheduled to Run at
S ZTSK=TASK D ISQED^%ZTLOAD
I $G(ZTSK(0)),$D(ZTSK("D"))#10 D
. S INFO(OFFSET+11)=$$HTFM^XLFDT(ZTSK("D"))
;--- Task Log
S INFO(OFFSET+12)=$G(RORBUF(798.8,IENS,2.03,"I"))
;--- Job Number
S INFO(OFFSET+13)=$G(RORBUF(798.8,IENS,2.04,"I"))
;--- User Comment
S INFO(OFFSET+14)=$G(RORBUF(798.8,IENS,1.01,"I"))
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORTSK03 2695 printed Dec 13, 2024@01:43:31 Page 2
RORTSK03 ;HCIOFO/SG - TASK MANAGER OVERFLOW CODE ; 8/30/05 8:34am
+1 ;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
+2 ;
+3 QUIT
+4 ;
+5 ;***** PREPARE THE TASK PARAMETERS
+6 ;
+7 ; .PARAMS Reference to a local array that contains
+8 ; the task parameters
+9 ;
+10 ; Return Values:
+11 ; <0 Error code
+12 ; 0 Ok
+13 ;
PARAMS(PARAMS) ;
+1 NEW I,NAME,NODE,SUBS,TMP
+2 SET I=""
+3 FOR
SET I=$ORDER(PARAMS(I))
if I=""
QUIT
Begin DoDot:1
+4 SET NAME=$TRANSLATE($PIECE(PARAMS(I),"=")," ")
if NAME=""
QUIT
+5 SET TMP=$PIECE(NAME,"(")
if TMP=""
QUIT
+6 SET NODE="RORTSK(""PARAMS"","""_TMP_""""
+7 SET TMP=$PIECE(NAME,"(",2,999)
+8 SET NODE=$SELECT(TMP'="":NODE_","_TMP,1:NODE_")")
+9 SET @NODE=$$TRIM^XLFSTR($PIECE(PARAMS(I),"=",2,999))
End DoDot:1
+10 QUIT 0
+11 ;
+12 ;***** FORMATS THE TASK INFORMATION FOR $$TASKINFO^RORTSK02
+13 ;
+14 ; OFFSET Offset for the subscripts
+15 ; .INFO Reference to a local variable (output):
+16 ; IENS The second subscript in the RORBUF array
+17 ; .RORBUF Referrence to a local variable containing output
+18 ; of the GETS^DIQ procedure
+19 ; FLAGS Characters controlling behavior of the function
+20 ;
+21 ; Return Values:
+22 ; <0 Error code
+23 ; 0 Ok
+24 ;
FRMTI(OFFSET,INFO,IENS,RORBUF,FLAGS) ;
+1 NEW I,TMP,ZTCPU,ZTSK
+2 ;--- Task Type
+3 IF $GET(RORBUF(798.8,IENS,.02,"I"))'=""
Begin DoDot:1
+4 SET I=OFFSET+2
SET INFO(I)=RORBUF(798.8,IENS,.02,"I")
+5 if FLAGS["E"
SET $PIECE(INFO(I),U,2)=$GET(RORBUF(798.8,IENS,.02,"E"))
End DoDot:1
+6 ;--- Registry
+7 IF $GET(RORBUF(798.8,IENS,.03,"I"))'=""
Begin DoDot:1
+8 SET I=OFFSET+3
SET INFO(I)=RORBUF(798.8,IENS,.03,"I")
+9 if FLAGS["E"
SET $PIECE(INFO(I),U,2)=$GET(RORBUF(798.8,IENS,.03,"E"))
End DoDot:1
+10 ;--- Report
+11 SET TMP=+$GET(RORBUF(798.8,IENS,.04,"I"))
+12 IF TMP>0
SET TMP=$$RPCODE^RORUTL08(TMP)
IF TMP'=""
Begin DoDot:1
+13 SET I=OFFSET+4
SET INFO(I)=TMP
+14 if FLAGS["E"
SET $PIECE(INFO(I),U,2)=$GET(RORBUF(798.8,IENS,.04,"E"))
End DoDot:1
+15 ;--- Description
+16 SET INFO(OFFSET+5)=$GET(RORBUF(798.8,IENS,.05,"I"))
+17 ;--- Creation Time
+18 IF $GET(RORBUF(798.8,IENS,.07,"I"))'=""
Begin DoDot:1
+19 SET INFO(OFFSET+7)=RORBUF(798.8,IENS,.07,"I")
End DoDot:1
+20 ;--- User
+21 IF $GET(RORBUF(798.8,IENS,.08,"I"))'=""
Begin DoDot:1
+22 SET I=OFFSET+8
SET INFO(I)=RORBUF(798.8,IENS,.08,"I")
+23 if FLAGS["E"
SET $PIECE(INFO(I),U,2)=$GET(RORBUF(798.8,IENS,.08,"E"))
End DoDot:1
+24 ;--- Completion Time
+25 IF $GET(RORBUF(798.8,IENS,2.02,"I"))'=""
Begin DoDot:1
+26 SET INFO(OFFSET+9)=RORBUF(798.8,IENS,2.02,"I")
End DoDot:1
+27 ;--- Progress Percentage
+28 SET TMP=$GET(RORBUF(798.8,IENS,4,"I"))
+29 SET INFO(OFFSET+10)=$SELECT(TMP'="":$JUSTIFY(TMP,0,2),1:"")
+30 ;--- Scheduled to Run at
+31 SET ZTSK=TASK
DO ISQED^%ZTLOAD
+32 IF $GET(ZTSK(0))
IF $DATA(ZTSK("D"))#10
Begin DoDot:1
+33 SET INFO(OFFSET+11)=$$HTFM^XLFDT(ZTSK("D"))
End DoDot:1
+34 ;--- Task Log
+35 SET INFO(OFFSET+12)=$GET(RORBUF(798.8,IENS,2.03,"I"))
+36 ;--- Job Number
+37 SET INFO(OFFSET+13)=$GET(RORBUF(798.8,IENS,2.04,"I"))
+38 ;--- User Comment
+39 SET INFO(OFFSET+14)=$GET(RORBUF(798.8,IENS,1.01,"I"))
+40 QUIT 0