source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCEWKLD.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1FSCEWKLD ;SLC/STAFF-NOIS Edit Workload ;9/6/98 20:42
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4WKLD(CALL,CHECK) ; from FSCEL, FSCEN, FSCLMPE1, FSCLMPES
5 I '$$ACCESS^FSCU(DUZ,"SPEC") Q ;I '$D(^FSC("SPEC",DUZ,0)) Q
6 Q:'$D(^FSCD("CALL",CALL,0)) Q:$P(^(0),U,2)=99
7 I $G(CHECK),'$$WKLD^FSCEUD(DUZ) Q
8 N DATE,HRS,OK,OLDHRS
9 W !!,"Workload Time"
10 D DATE(CALL,.DATE,.OK) I 'OK Q
11 S (OLDHRS,HRS)=$$HCUD^FSCWKLD(CALL,DUZ,DATE)
12 D HRS(CALL,DATE,.HRS,.OK) I 'OK Q
13 I HRS D UPDATE(CALL,HRS,DATE,DUZ)
14 Q
15 ;
16DATE(CALL,DATE,OK) ;
17 N CDATE,DIR,RDATE,WEDATE,X,Y K DIR
18 S OK=1
19 S RDATE=$P($G(^FSCD("CALL",CALL,0)),U,3)
20 I 'RDATE S OK=0 Q
21 S CDATE=$P($G(^FSCD("CALL",CALL,0)),U,4)
22 I 'CDATE S CDATE=DT
23 S WEDATE=$$WEDATE^FSCUP
24 I WEDATE,RDATE>WEDATE S RDATE=WEDATE
25 I RDATE>CDATE W !,"Unable to edit workload for this call",$C(7) S OK=0 Q
26 S DIR(0)="DA^"_RDATE_":"_CDATE_":EX",DIR("A")="Date of action: ",DIR("B")="TODAY"
27 S DIR("?",1)="Enter the date for this particular action."
28 S DIR("?",2)="Date must be from "_$$FMTE^XLFDT(RDATE)_" to "_$$FMTE^XLFDT(CDATE)_"."
29 S DIR("?",3)="Date must be from when call was open to closed and cannot"
30 S DIR("?",4)="be before T-"_+$P($G(^FSC("PARAM",1,0)),U,10)_"."
31 S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
32 S DIR("??")="FSC U1 NOIS"
33 D ^DIR K DIR
34 I $D(DIRUT) S OK=0 Q
35 S DATE=Y
36 Q
37 ;
38HRS(CALL,DATE,HRS,OK) ;
39 N DIR,HC,HUC,HUD,HIGHHRS,LOWHRS,X,Y K DIR
40 S OK=1
41 S HC=$$HC^FSCWKLD(CALL),HUC=$$HUC^FSCWKLD(DUZ,CALL),HUD=$$HUD^FSCWKLD(DUZ,DATE)
42 I HUD W !,"Your hours on all calls for this date is ",HUD,"."
43 I HC W !,"Total hours on this call is ",HC,"."
44 I HUC W !,"Your hours on this call is ",HUC," (Total)" I $L(HRS) W ", ",HRS," (",$$FMTE^XLFDT(DATE),")."
45 S HIGHHRS=24-HUD
46 S LOWHRS=-HRS
47 S DIR(0)="NAO^"_LOWHRS_":"_HIGHHRS_":2",DIR("A")="Enter any changes for this date: "
48 S DIR("?",1)="Enter changes to time on this call for this date."
49 S DIR("?",2)="Enter a number ("_LOWHRS_" to "_HIGHHRS_") with no more than 2 decimal places."
50 S DIR("?",3)="This time is added to hours spent on the call for "_$$FMTE^XLFDT(DATE)_"."
51 S DIR("?",4)="Enter '^' to exit without making a note or '??' for more help."
52 S DIR("?")="^D HELP^FSCU(.DIR)"
53 S DIR("??")="FSC U1 NOIS"
54 D ^DIR K DIR
55 I $D(DIRUT),Y'="" S OK=0 Q
56 S HRS=Y
57 Q
58 ;
59UPDATE(CALL,HRS,DATE,USER) ; from FSCRPCEB, FSCRPCEW
60 Q:'$G(CALL) Q:'$G(HRS) Q:'$G(DATE) Q:'$G(USER)
61 N DA,DATA,DIK,INVALID,NUM,OK,WKLD
62 S INVALID=$S($P(^FSCD("CALL",CALL,0),U,2)=11:1,1:"")
63 S WKLD=$G(^FSCD("WKLD","AK",CALL,USER,DATE))
64 I 'WKLD S OK=1 D I 'OK Q
65 .S DATA=CALL_U_USER_U_DATE_U_HRS_U_INVALID
66 .S NUM=1+$P(^FSCD("WKLD",0),U,3)
67 .L +^FSCD("WKLD",0):30 I '$T S OK=0 Q ; needs ok
68 .F Q:'$D(^FSCD("WKLD",NUM,0)) S NUM=NUM+1
69 .S ^FSCD("WKLD",NUM,0)=DATA
70 .S $P(^FSCD("WKLD",0),U,3)=NUM,$P(^(0),U,4)=$P(^(0),U,4)+1
71 .L -^FSCD("WKLD",0)
72 .S DIK="^FSCD(""WKLD"",",DA=NUM D IX1^DIK
73 I WKLD D
74 .S $P(^(0),U,4)=$P(^FSCD("WKLD",WKLD,0),U,4)+HRS
75 ;S $P(^FSCD("CALL",CALL,0),U,13)=$$HC^FSCWKLD(CALL)
76 D TOTHRS(CALL,$$HC^FSCWKLD(CALL))
77 Q
78 ;
79GOODWKLD(CALL) ; from FSCLMPES
80 I '$D(^FSCD("CALL",CALL,0)) Q
81 N TOTHRS,WKLD
82 S (TOTHRS,WKLD)=0 F S WKLD=$O(^FSCD("WKLD","B",CALL,WKLD)) Q:WKLD<1 D
83 .I $D(^FSCD("WKLD",WKLD,0)) S $P(^(0),U,5)="",TOTHRS=TOTHRS+$P(^(0),U,4)
84 ;S $P(^FSCD("CALL",CALL,0),U,13)=TOTHRS
85 D TOTHRS(CALL,TOTHRS)
86 Q
87 ;
88BADWKLD(CALL) ; from FSCLMPES
89 I '$D(^FSCD("CALL",CALL,0)) Q
90 N WKLD
91 S WKLD=0 F S WKLD=$O(^FSCD("WKLD","B",CALL,WKLD)) Q:WKLD<1 D
92 .I $D(^FSCD("WKLD",WKLD,0)) S $P(^(0),U,5)=1
93 ;S $P(^FSCD("CALL",CALL,0),U,13)=0
94 D TOTHRS(CALL,0)
95 Q
96 ;
97TOTHRS(DA,HRS) ;
98 N DR,DIE,X,Y
99 S DIE="^FSCD(""CALL"","
100 S DR="20///"_HRS
101 D ^DIE
102 Q
Note: See TracBrowser for help on using the repository browser.