FSCRPCOW ;SLC/STAFF-NOIS RPC Other Workload ;1/18/97 21:32
;;1.1;NOIS;;Sep 06, 1998
;
WKLD(IN,OUT) ; from FSCRPX (RPCCallWorkload)
N CALL,CNT,DATE,HRS,TOTHRS,USER,WKLD
S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
I 'CALL S ^TMP("FSCRPC",$J,"OUTPUT",1)="no information" Q
S CNT=0
K ^TMP("FSCWKLD",$J)
S TOTHRS=+$P(^FSCD("CALL",CALL,0),U,13)
I 'TOTHRS D
.S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)="No time entries."
E D
.S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)=" Total hours: "_TOTHRS
.S WKLD=0 F S WKLD=$O(^FSCD("WKLD","B",CALL,WKLD)) Q:WKLD<1 D
..S DATE=$P(^FSCD("WKLD",WKLD,0),U,3),HRS=+$P(^(0),U,4),USER=$P(^(0),U,2),USER=$$VALUE^FSCGET(USER,7103.5,1)
..I $L(DATE),$L(USER) D
...S ^TMP("FSCWKLD",$J,"DU",DATE,USER)=HRS
...S ^TMP("FSCWKLD",$J,"UD",USER,DATE)=HRS
...S ^(DATE)=$G(^TMP("FSCWKLD",$J,"D",DATE))+HRS
...S ^(USER)=$G(^TMP("FSCWKLD",$J,"U",USER))+HRS
.S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)="By Date | Specialist:"
.S DATE=0 F S DATE=$O(^TMP("FSCWKLD",$J,"DU",DATE)) Q:DATE<1 D
..S CNT=CNT+1,^TMP("FSCWKLD",$J,"OUTPUT",CNT)=" "_$$FMTE^XLFDT(DATE)_" ("_^TMP("FSCWKLD",$J,"D",DATE)_")"
..S USER="" F S USER=$O(^TMP("FSCWKLD",$J,"DU",DATE,USER)) Q:USER="" S HRS=^(USER) D
...S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)=" "_USER
...S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=$$SETSTR^VALM1(HRS,^TMP("FSCRPC",$J,"OUTPUT",CNT),50,$L(HRS))
.S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)="By Specialist | Date:"
.S USER="" F S USER=$O(^TMP("FSCWKLD",$J,"UD",USER)) Q:USER="" D
..S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)=USER_" ("_^TMP("FSCWKLD",$J,"U",USER)_")"
..S DATE=0 F S DATE=$O(^TMP("FSCWKLD",$J,"UD",USER,DATE)) Q:DATE<1 S HRS=^(DATE) D
...S CNT=CNT+1,^TMP("FSCRPC",$J,"OUTPUT",CNT)=" "_$$FMTE^XLFDT(DATE)
...S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=$$SETSTR^VALM1(HRS,^TMP("FSCRPC",$J,"OUTPUT",CNT),50,$L(HRS))
K ^TMP("FSCWKLD",$J)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRPCOW 1955 printed Dec 13, 2024@02:19:42 Page 2
FSCRPCOW ;SLC/STAFF-NOIS RPC Other Workload ;1/18/97 21:32
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
WKLD(IN,OUT) ; from FSCRPX (RPCCallWorkload)
+1 NEW CALL,CNT,DATE,HRS,TOTHRS,USER,WKLD
+2 SET CALL=+$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 IF 'CALL
SET ^TMP("FSCRPC",$JOB,"OUTPUT",1)="no information"
QUIT
+4 SET CNT=0
+5 KILL ^TMP("FSCWKLD",$JOB)
+6 SET TOTHRS=+$PIECE(^FSCD("CALL",CALL,0),U,13)
+7 IF 'TOTHRS
Begin DoDot:1
+8 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="No time entries."
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=" Total hours: "_TOTHRS
+11 SET WKLD=0
FOR
SET WKLD=$ORDER(^FSCD("WKLD","B",CALL,WKLD))
if WKLD<1
QUIT
Begin DoDot:2
+12 SET DATE=$PIECE(^FSCD("WKLD",WKLD,0),U,3)
SET HRS=+$PIECE(^(0),U,4)
SET USER=$PIECE(^(0),U,2)
SET USER=$$VALUE^FSCGET(USER,7103.5,1)
+13 IF $LENGTH(DATE)
IF $LENGTH(USER)
Begin DoDot:3
+14 SET ^TMP("FSCWKLD",$JOB,"DU",DATE,USER)=HRS
+15 SET ^TMP("FSCWKLD",$JOB,"UD",USER,DATE)=HRS
+16 SET ^(DATE)=$GET(^TMP("FSCWKLD",$JOB,"D",DATE))+HRS
+17 SET ^(USER)=$GET(^TMP("FSCWKLD",$JOB,"U",USER))+HRS
End DoDot:3
End DoDot:2
+18 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="By Date | Specialist:"
+19 SET DATE=0
FOR
SET DATE=$ORDER(^TMP("FSCWKLD",$JOB,"DU",DATE))
if DATE<1
QUIT
Begin DoDot:2
+20 SET CNT=CNT+1
SET ^TMP("FSCWKLD",$JOB,"OUTPUT",CNT)=" "_$$FMTE^XLFDT(DATE)_" ("_^TMP("FSCWKLD",$JOB,"D",DATE)_")"
+21 SET USER=""
FOR
SET USER=$ORDER(^TMP("FSCWKLD",$JOB,"DU",DATE,USER))
if USER=""
QUIT
SET HRS=^(USER)
Begin DoDot:3
+22 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=" "_USER
+23 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=$$SETSTR^VALM1(HRS,^TMP("FSCRPC",$JOB,"OUTPUT",CNT),50,$LENGTH(HRS))
End DoDot:3
End DoDot:2
+24 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="By Specialist | Date:"
+25 SET USER=""
FOR
SET USER=$ORDER(^TMP("FSCWKLD",$JOB,"UD",USER))
if USER=""
QUIT
Begin DoDot:2
+26 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=USER_" ("_^TMP("FSCWKLD",$JOB,"U",USER)_")"
+27 SET DATE=0
FOR
SET DATE=$ORDER(^TMP("FSCWKLD",$JOB,"UD",USER,DATE))
if DATE<1
QUIT
SET HRS=^(DATE)
Begin DoDot:3
+28 SET CNT=CNT+1
SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=" "_$$FMTE^XLFDT(DATE)
+29 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=$$SETSTR^VALM1(HRS,^TMP("FSCRPC",$JOB,"OUTPUT",CNT),50,$LENGTH(HRS))
End DoDot:3
End DoDot:2
End DoDot:1
+30 KILL ^TMP("FSCWKLD",$JOB)
+31 QUIT