FSCEWKLD ;SLC/STAFF-NOIS Edit Workload ;9/6/98 20:42
;;1.1;NOIS;;Sep 06, 1998
;
WKLD(CALL,CHECK) ; from FSCEL, FSCEN, FSCLMPE1, FSCLMPES
I '$$ACCESS^FSCU(DUZ,"SPEC") Q ;I '$D(^FSC("SPEC",DUZ,0)) Q
Q:'$D(^FSCD("CALL",CALL,0)) Q:$P(^(0),U,2)=99
I $G(CHECK),'$$WKLD^FSCEUD(DUZ) Q
N DATE,HRS,OK,OLDHRS
W !!,"Workload Time"
D DATE(CALL,.DATE,.OK) I 'OK Q
S (OLDHRS,HRS)=$$HCUD^FSCWKLD(CALL,DUZ,DATE)
D HRS(CALL,DATE,.HRS,.OK) I 'OK Q
I HRS D UPDATE(CALL,HRS,DATE,DUZ)
Q
;
DATE(CALL,DATE,OK) ;
N CDATE,DIR,RDATE,WEDATE,X,Y K DIR
S OK=1
S RDATE=$P($G(^FSCD("CALL",CALL,0)),U,3)
I 'RDATE S OK=0 Q
S CDATE=$P($G(^FSCD("CALL",CALL,0)),U,4)
I 'CDATE S CDATE=DT
S WEDATE=$$WEDATE^FSCUP
I WEDATE,RDATE>WEDATE S RDATE=WEDATE
I RDATE>CDATE W !,"Unable to edit workload for this call",$C(7) S OK=0 Q
S DIR(0)="DA^"_RDATE_":"_CDATE_":EX",DIR("A")="Date of action: ",DIR("B")="TODAY"
S DIR("?",1)="Enter the date for this particular action."
S DIR("?",2)="Date must be from "_$$FMTE^XLFDT(RDATE)_" to "_$$FMTE^XLFDT(CDATE)_"."
S DIR("?",3)="Date must be from when call was open to closed and cannot"
S DIR("?",4)="be before T-"_+$P($G(^FSC("PARAM",1,0)),U,10)_"."
S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) S OK=0 Q
S DATE=Y
Q
;
HRS(CALL,DATE,HRS,OK) ;
N DIR,HC,HUC,HUD,HIGHHRS,LOWHRS,X,Y K DIR
S OK=1
S HC=$$HC^FSCWKLD(CALL),HUC=$$HUC^FSCWKLD(DUZ,CALL),HUD=$$HUD^FSCWKLD(DUZ,DATE)
I HUD W !,"Your hours on all calls for this date is ",HUD,"."
I HC W !,"Total hours on this call is ",HC,"."
I HUC W !,"Your hours on this call is ",HUC," (Total)" I $L(HRS) W ", ",HRS," (",$$FMTE^XLFDT(DATE),")."
S HIGHHRS=24-HUD
S LOWHRS=-HRS
S DIR(0)="NAO^"_LOWHRS_":"_HIGHHRS_":2",DIR("A")="Enter any changes for this date: "
S DIR("?",1)="Enter changes to time on this call for this date."
S DIR("?",2)="Enter a number ("_LOWHRS_" to "_HIGHHRS_") with no more than 2 decimal places."
S DIR("?",3)="This time is added to hours spent on the call for "_$$FMTE^XLFDT(DATE)_"."
S DIR("?",4)="Enter '^' to exit without making a note or '??' for more help."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT),Y'="" S OK=0 Q
S HRS=Y
Q
;
UPDATE(CALL,HRS,DATE,USER) ; from FSCRPCEB, FSCRPCEW
Q:'$G(CALL) Q:'$G(HRS) Q:'$G(DATE) Q:'$G(USER)
N DA,DATA,DIK,INVALID,NUM,OK,WKLD
S INVALID=$S($P(^FSCD("CALL",CALL,0),U,2)=11:1,1:"")
S WKLD=$G(^FSCD("WKLD","AK",CALL,USER,DATE))
I 'WKLD S OK=1 D I 'OK Q
.S DATA=CALL_U_USER_U_DATE_U_HRS_U_INVALID
.S NUM=1+$P(^FSCD("WKLD",0),U,3)
.L +^FSCD("WKLD",0):30 I '$T S OK=0 Q ; needs ok
.F Q:'$D(^FSCD("WKLD",NUM,0)) S NUM=NUM+1
.S ^FSCD("WKLD",NUM,0)=DATA
.S $P(^FSCD("WKLD",0),U,3)=NUM,$P(^(0),U,4)=$P(^(0),U,4)+1
.L -^FSCD("WKLD",0)
.S DIK="^FSCD(""WKLD"",",DA=NUM D IX1^DIK
I WKLD D
.S $P(^(0),U,4)=$P(^FSCD("WKLD",WKLD,0),U,4)+HRS
;S $P(^FSCD("CALL",CALL,0),U,13)=$$HC^FSCWKLD(CALL)
D TOTHRS(CALL,$$HC^FSCWKLD(CALL))
Q
;
GOODWKLD(CALL) ; from FSCLMPES
I '$D(^FSCD("CALL",CALL,0)) Q
N TOTHRS,WKLD
S (TOTHRS,WKLD)=0 F S WKLD=$O(^FSCD("WKLD","B",CALL,WKLD)) Q:WKLD<1 D
.I $D(^FSCD("WKLD",WKLD,0)) S $P(^(0),U,5)="",TOTHRS=TOTHRS+$P(^(0),U,4)
;S $P(^FSCD("CALL",CALL,0),U,13)=TOTHRS
D TOTHRS(CALL,TOTHRS)
Q
;
BADWKLD(CALL) ; from FSCLMPES
I '$D(^FSCD("CALL",CALL,0)) Q
N WKLD
S WKLD=0 F S WKLD=$O(^FSCD("WKLD","B",CALL,WKLD)) Q:WKLD<1 D
.I $D(^FSCD("WKLD",WKLD,0)) S $P(^(0),U,5)=1
;S $P(^FSCD("CALL",CALL,0),U,13)=0
D TOTHRS(CALL,0)
Q
;
TOTHRS(DA,HRS) ;
N DR,DIE,X,Y
S DIE="^FSCD(""CALL"","
S DR="20///"_HRS
D ^DIE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCEWKLD 3705 printed Oct 16, 2024@18:18:21 Page 2
FSCEWKLD ;SLC/STAFF-NOIS Edit Workload ;9/6/98 20:42
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
WKLD(CALL,CHECK) ; from FSCEL, FSCEN, FSCLMPE1, FSCLMPES
+1 ;I '$D(^FSC("SPEC",DUZ,0)) Q
IF '$$ACCESS^FSCU(DUZ,"SPEC")
QUIT
+2 if '$DATA(^FSCD("CALL",CALL,0))
QUIT
if $PIECE(^(0),U,2)=99
QUIT
+3 IF $GET(CHECK)
IF '$$WKLD^FSCEUD(DUZ)
QUIT
+4 NEW DATE,HRS,OK,OLDHRS
+5 WRITE !!,"Workload Time"
+6 DO DATE(CALL,.DATE,.OK)
IF 'OK
QUIT
+7 SET (OLDHRS,HRS)=$$HCUD^FSCWKLD(CALL,DUZ,DATE)
+8 DO HRS(CALL,DATE,.HRS,.OK)
IF 'OK
QUIT
+9 IF HRS
DO UPDATE(CALL,HRS,DATE,DUZ)
+10 QUIT
+11 ;
DATE(CALL,DATE,OK) ;
+1 NEW CDATE,DIR,RDATE,WEDATE,X,Y
KILL DIR
+2 SET OK=1
+3 SET RDATE=$PIECE($GET(^FSCD("CALL",CALL,0)),U,3)
+4 IF 'RDATE
SET OK=0
QUIT
+5 SET CDATE=$PIECE($GET(^FSCD("CALL",CALL,0)),U,4)
+6 IF 'CDATE
SET CDATE=DT
+7 SET WEDATE=$$WEDATE^FSCUP
+8 IF WEDATE
IF RDATE>WEDATE
SET RDATE=WEDATE
+9 IF RDATE>CDATE
WRITE !,"Unable to edit workload for this call",$CHAR(7)
SET OK=0
QUIT
+10 SET DIR(0)="DA^"_RDATE_":"_CDATE_":EX"
SET DIR("A")="Date of action: "
SET DIR("B")="TODAY"
+11 SET DIR("?",1)="Enter the date for this particular action."
+12 SET DIR("?",2)="Date must be from "_$$FMTE^XLFDT(RDATE)_" to "_$$FMTE^XLFDT(CDATE)_"."
+13 SET DIR("?",3)="Date must be from when call was open to closed and cannot"
+14 SET DIR("?",4)="be before T-"_+$PIECE($GET(^FSC("PARAM",1,0)),U,10)_"."
+15 SET DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
+16 SET DIR("??")="FSC U1 NOIS"
+17 DO ^DIR
KILL DIR
+18 IF $DATA(DIRUT)
SET OK=0
QUIT
+19 SET DATE=Y
+20 QUIT
+21 ;
HRS(CALL,DATE,HRS,OK) ;
+1 NEW DIR,HC,HUC,HUD,HIGHHRS,LOWHRS,X,Y
KILL DIR
+2 SET OK=1
+3 SET HC=$$HC^FSCWKLD(CALL)
SET HUC=$$HUC^FSCWKLD(DUZ,CALL)
SET HUD=$$HUD^FSCWKLD(DUZ,DATE)
+4 IF HUD
WRITE !,"Your hours on all calls for this date is ",HUD,"."
+5 IF HC
WRITE !,"Total hours on this call is ",HC,"."
+6 IF HUC
WRITE !,"Your hours on this call is ",HUC," (Total)"
IF $LENGTH(HRS)
WRITE ", ",HRS," (",$$FMTE^XLFDT(DATE),")."
+7 SET HIGHHRS=24-HUD
+8 SET LOWHRS=-HRS
+9 SET DIR(0)="NAO^"_LOWHRS_":"_HIGHHRS_":2"
SET DIR("A")="Enter any changes for this date: "
+10 SET DIR("?",1)="Enter changes to time on this call for this date."
+11 SET DIR("?",2)="Enter a number ("_LOWHRS_" to "_HIGHHRS_") with no more than 2 decimal places."
+12 SET DIR("?",3)="This time is added to hours spent on the call for "_$$FMTE^XLFDT(DATE)_"."
+13 SET DIR("?",4)="Enter '^' to exit without making a note or '??' for more help."
+14 SET DIR("?")="^D HELP^FSCU(.DIR)"
+15 SET DIR("??")="FSC U1 NOIS"
+16 DO ^DIR
KILL DIR
+17 IF $DATA(DIRUT)
IF Y'=""
SET OK=0
QUIT
+18 SET HRS=Y
+19 QUIT
+20 ;
UPDATE(CALL,HRS,DATE,USER) ; from FSCRPCEB, FSCRPCEW
+1 if '$GET(CALL)
QUIT
if '$GET(HRS)
QUIT
if '$GET(DATE)
QUIT
if '$GET(USER)
QUIT
+2 NEW DA,DATA,DIK,INVALID,NUM,OK,WKLD
+3 SET INVALID=$SELECT($PIECE(^FSCD("CALL",CALL,0),U,2)=11:1,1:"")
+4 SET WKLD=$GET(^FSCD("WKLD","AK",CALL,USER,DATE))
+5 IF 'WKLD
SET OK=1
Begin DoDot:1
+6 SET DATA=CALL_U_USER_U_DATE_U_HRS_U_INVALID
+7 SET NUM=1+$PIECE(^FSCD("WKLD",0),U,3)
+8 ; needs ok
LOCK +^FSCD("WKLD",0):30
IF '$TEST
SET OK=0
QUIT
+9 FOR
if '$DATA(^FSCD("WKLD",NUM,0))
QUIT
SET NUM=NUM+1
+10 SET ^FSCD("WKLD",NUM,0)=DATA
+11 SET $PIECE(^FSCD("WKLD",0),U,3)=NUM
SET $PIECE(^(0),U,4)=$PIECE(^(0),U,4)+1
+12 LOCK -^FSCD("WKLD",0)
+13 SET DIK="^FSCD(""WKLD"","
SET DA=NUM
DO IX1^DIK
End DoDot:1
IF 'OK
QUIT
+14 IF WKLD
Begin DoDot:1
+15 SET $PIECE(^(0),U,4)=$PIECE(^FSCD("WKLD",WKLD,0),U,4)+HRS
End DoDot:1
+16 ;S $P(^FSCD("CALL",CALL,0),U,13)=$$HC^FSCWKLD(CALL)
+17 DO TOTHRS(CALL,$$HC^FSCWKLD(CALL))
+18 QUIT
+19 ;
GOODWKLD(CALL) ; from FSCLMPES
+1 IF '$DATA(^FSCD("CALL",CALL,0))
QUIT
+2 NEW TOTHRS,WKLD
+3 SET (TOTHRS,WKLD)=0
FOR
SET WKLD=$ORDER(^FSCD("WKLD","B",CALL,WKLD))
if WKLD<1
QUIT
Begin DoDot:1
+4 IF $DATA(^FSCD("WKLD",WKLD,0))
SET $PIECE(^(0),U,5)=""
SET TOTHRS=TOTHRS+$PIECE(^(0),U,4)
End DoDot:1
+5 ;S $P(^FSCD("CALL",CALL,0),U,13)=TOTHRS
+6 DO TOTHRS(CALL,TOTHRS)
+7 QUIT
+8 ;
BADWKLD(CALL) ; from FSCLMPES
+1 IF '$DATA(^FSCD("CALL",CALL,0))
QUIT
+2 NEW WKLD
+3 SET WKLD=0
FOR
SET WKLD=$ORDER(^FSCD("WKLD","B",CALL,WKLD))
if WKLD<1
QUIT
Begin DoDot:1
+4 IF $DATA(^FSCD("WKLD",WKLD,0))
SET $PIECE(^(0),U,5)=1
End DoDot:1
+5 ;S $P(^FSCD("CALL",CALL,0),U,13)=0
+6 DO TOTHRS(CALL,0)
+7 QUIT
+8 ;
TOTHRS(DA,HRS) ;
+1 NEW DR,DIE,X,Y
+2 SET DIE="^FSCD(""CALL"","
+3 SET DR="20///"_HRS
+4 DO ^DIE
+5 QUIT