AZXZMGT1 ;SUPPORT DATABASE MANAGEMENT PROGRAM[ 05/31/95 11:35 AM ]
;04/28/92 JOHN H. LYNCH
;
;THIS ROUTINE WILL ALLOW A USER TO PRINT OUT
;A MONTHLY REPORT SHOWING ALL SERVICE UNITS,
;THE NUMBER OF SUPPORT CALLS IN A GIVEN PERIOD
;AND THE TOTAL NUMBER OF MAN HOURS SPENT ON CALLS
;FOR THAT SERVICE UNIT DURING THE GIVEN PERIOD.
MAIN ;AZXZMGT1 PROGRAM CONTROL
;INITIALIZE LOCAL VARIABLES
S FILE="1991012" ;FILE NUMBER (SUPPDB)
D MGMTPRNT
ANOTHER I LDATE'="^" R !!,"Do you want to print another Management Report? Y// ",YN
I LDATE="^" S YN="N"
I YN="" S YN="Y"
I YN="Y" G MAIN
K FILE,YN,LDATE,UDATE,X,SNUM,TIME,TTIME,CALLS
K TCALLS,SITE,Y,LDATE1,UDATE1,SITE,SITENAME
Q
MGMTPRNT ;PRINTOUT MANAGEMENT REPORT
;CLEAR SCREEN
W @IOF
W !!!,"Management Time Report Print..."
W !!!! H 1
LBDATE R !,"Select Lower Boundary Date :",LDATE
;IF "^" QUIT AND RETURN TO MAINMENU
I LDATE="^" G ANOTHER
;IF "" SET LDATE = LOWEST DATE POSSIBLE & UDATE = CURRENT DATE
;GO RIGHT TO PRINTOUT; THEN QUIT
I LDATE="" D DEFAULT D PRINTOUT Q
;IF "?" GIVE HELP AND RETURN TO LDATE PROMPT
I LDATE="?" W !!,"Give the lower boundary date for Management Report Printout",!,"OR press return to receive a report on total database [mm/dd/yy].",! G LBDATE
;CHECK TO SEE IF A VALID DATE HAS BEEN ENTERED
I LDATE'?2N1"/"2N1"/"2N W !!,"Illegal date; check format and re-enter lower boundary date.",!,*7 G LBDATE
;CONVERT DATE (CONVERT)
S X=LDATE ;X = DATE TO CONVERT USING ^%DT
D CONVERT
;DATE FORMAT WAS ILLEGAL
I Y<1 W !!,"Illegal date; check format and re-enter upper boundary date.",!,*7 G LBDATE
S LDATE=Y
UBDATE R !,"Select Upper Boundary Date :",UDATE
;IF "^" RETURN TO PREVIOUS PROMPT (LBDATE)
I UDATE="^" G LBDATE
;IF "" WRITE "UPPER BOUNDARY MUST BE ENTERED"
I UDATE="" W !!,"An upper boundary date must be entered when a lower limit has been given.",!,*7 G UBDATE
;IF "?" GIVE HELP AND RETURN TO LDATE PROMPT
I UDATE="?" W !!,"Give the upper boundary date for Management Report Printout [mm/dd/yy].",! G UBDATE
;CHECK TO SEE IF A VALID DATE HAS BEEN ENTERED
I UDATE'?2N1"/"2N1"/"2N W !!,"Illegal date; check format and re-enter upper boundary date.",!,*7 G UBDATE
;CONVERT DATE (CONVERT)
S X=UDATE ;X = DATE TO CONVERT USING ^%DT
D CONVERT
;DATE FORMAT WAS ILLEGAL
I Y<1 W !!,"Illegal date; check format and re-enter upper boundary date.",!,*7 G UBDATE
S UDATE=Y
;CHECK TO SEE IF UDATE >= LDATE
I UDATE'>LDATE!UDATE=LDATE W !!,"Upper boundary date must be greater than or equal to lower boundary date.",!,*7 G UBDATE
;DO PRINTOUT; THEN QUIT
D ^%ZIS U IO
D PRINTOUT
Q
PRINTOUT ;PRINTOUT MANAGEMENT REPORT
;SUB-ROUTINES: PRINT2,PRINT3
S SNUM=0 ;SNUM = SUPPORT NUMBER
S TIME=0 ;AVERAGE TIME PER CALL PER SITE
S TTIME=0 ;AVERAGE TIME PER CALL FOR ALL SITES
S CALLS=0 ;NUMBER OF CALLS PER SITE
S TCALLS=0 ;NUMBER OF CALLS FOR ALL SITES
S SITE=1 ;INITIALIZE SITE TO FIRST IN DATABASE
;CALL DEVICE
;D ^%ZIS U IO
S Y=LDATE ;SET Y TO LOWER DATE FOR REPORT OUTPUT
D DD^%DT ;CONVERT CURRENT DATE
S LDATE1=Y ;REPORT LOWER DATE
S Y=UDATE ;SET Y TO UPPER DATE FOR REPORT OUTPUT
D DD^%DT ;CONVERT CURRENT DATE
S UDATE1=Y ;REPORT UPPER DATE
W @IOF ;CLEAR SCREEN WHEN OUTPUT TO TERMINAL
W !,"________________________________________________________________________________",!
W !,"Management Time Report",?35,"For Period:",?48,LDATE1," - ",?63,UDATE1
W !!,"Service Unit",?31,"Number of Calls",?57,"Call Time in Hours"
W !,"________________________________________________________________________________",!
PRINT2 ;SET UP TOTALS AND SITENAME
;SUB-ROUTINE OF PRINTOUT
S SNUM=$O(^DIZ(FILE,"D",SITE,SNUM))
I SNUM'="" I ($P(^DIZ(FILE,SNUM,0),U,4)'<LDATE)&($J($P(^DIZ(FILE,SNUM,0),U,4),7,0)'>UDATE) S CALLS=CALLS+1,TIME=TIME+$P(^DIZ(FILE,SNUM,5),U,2) G PRINT2
I SNUM'="" G PRINT2
D SITELKUP ;SET SITENAME USING SITE (NUMERIC)
D PRINT3 ;PRINT SUB-TOTALS PER SITE
S SITE=$O(^DIZ(FILE,"D",SITE)) ;GO TO NEXT SITE
I SITE'="" S TTIME=TTIME+TIME,TCALLS=TCALLS+CALLS,SNUM=0,TIME=0,CALLS=0 G PRINT2
W !!,"________________________________________________________________________________"
;******************HERE************
S TTIME=TTIME+TIME
W !!,?27,"Total Calls= ",$J(TCALLS,6),?56," Total Time= ",$J(TTIME/60,6,2)
W !!,"________________________________________________________________________________"
W:$E(IOST)="P" @IOF
D ^%ZISC
Q
PRINT3 ;PRINTOUT EACH INDIVIDUAL SITES SUB-TOTALS IN HOURS
;SUB-ROUTINE OF PRINTOUT
W !!,SITENAME,?40,$J(CALLS,6),?69,$J(TIME/60,6,2)
Q
DEFAULT ;SET DEFAULT DATES TO INCLUDE ALL CURRENT LOGS
S LDATE="2920401" ;SET TO EARLIER THAN EARLIEST POSSIBLE LOG DATE
S UDATE=DT ;SET TO CURRENT DATE
Q
CONVERT ;CONVERT USER DATES TO FILEMAN DATE FORMAT
;SET LOCAL VARIABLES
S %DT="EXT" ;E=ECHO ANSWER;X=EXACT DATE;T=TIME ALLOWED, NOT REQUIRED
D ^%DT ;VALUE RETURNED IN Y
Q
SITELKUP ;SET SITENAME USING A LOOKUP IN SITES FILE
;SITENAME = 1ST PIECE IN SITES FILE DFN
S SITENAME=$P(^DIZ(1991010,SITE,0),U,1)
Q
AZXZMGT1 ;SUPPORT DATABASE MANAGEMENT PROGRAM[ 05/31/95 11:35 AM ]
+1 ;04/28/92 JOHN H. LYNCH
+2 ;
+3 ;THIS ROUTINE WILL ALLOW A USER TO PRINT OUT
+4 ;A MONTHLY REPORT SHOWING ALL SERVICE UNITS,
+5 ;THE NUMBER OF SUPPORT CALLS IN A GIVEN PERIOD
+6 ;AND THE TOTAL NUMBER OF MAN HOURS SPENT ON CALLS
+7 ;FOR THAT SERVICE UNIT DURING THE GIVEN PERIOD.
+8 MAIN ;AZXZMGT1 PROGRAM CONTROL
+1 ;INITIALIZE LOCAL VARIABLES
+2 ;FILE NUMBER (SUPPDB)
SET FILE="1991012"
+3 +4 DO MGMTPRNT
ANOTHER IF LDATE'="^"
READ !!,"Do you want to print another Management Report? Y// ",YN
+1 IF LDATE="^"
SET YN="N"
+2 IF YN=""
SET YN="Y"
+3 IF YN="Y"
GOTO MAIN
+4 KILL FILE,YN,LDATE,UDATE,X,SNUM,TIME,TTIME,CALLS
+5 KILL TCALLS,SITE,Y,LDATE1,UDATE1,SITE,SITENAME
+6 QUIT
+7 MGMTPRNT ;PRINTOUT MANAGEMENT REPORT
+1 +2 ;CLEAR SCREEN
+3 WRITE @IOF
+4 +5 WRITE !!!,"Management Time Report Print..."
+6 WRITE !!!!
HANG 1
+7 LBDATE READ !,"Select Lower Boundary Date :",LDATE
+1 +2 ;IF "^" QUIT AND RETURN TO MAINMENU
+3 IF LDATE="^"
GOTO ANOTHER
+4 ;IF "" SET LDATE = LOWEST DATE POSSIBLE & UDATE = CURRENT DATE
+5 ;GO RIGHT TO PRINTOUT; THEN QUIT
+6 IF LDATE=""
DO DEFAULT
DO PRINTOUT
QUIT
+7 +8 ;IF "?" GIVE HELP AND RETURN TO LDATE PROMPT
+9 IF LDATE="?"
WRITE !!,"Give the lower boundary date for Management Report Printout",!,"OR press return to receive a report on total database [mm/dd/yy].",!
GOTO LBDATE
+10 +11 ;CHECK TO SEE IF A VALID DATE HAS BEEN ENTERED
+12 IF LDATE'?2N1"/"2N1"/"2N
WRITE !!,"Illegal date; check format and re-enter lower boundary date.",!,*7
GOTO LBDATE
+13 +14 ;CONVERT DATE (CONVERT)
+15 ;X = DATE TO CONVERT USING ^%DT
SET X=LDATE
+16 DO CONVERT
+17 ;DATE FORMAT WAS ILLEGAL
+18 IF Y<1
WRITE !!,"Illegal date; check format and re-enter upper boundary date.",!,*7
GOTO LBDATE
+19 SET LDATE=Y
+20 UBDATE READ !,"Select Upper Boundary Date :",UDATE
+1 +2 ;IF "^" RETURN TO PREVIOUS PROMPT (LBDATE)
+3 IF UDATE="^"
GOTO LBDATE
+4 +5 ;IF "" WRITE "UPPER BOUNDARY MUST BE ENTERED"
+6 IF UDATE=""
WRITE !!,"An upper boundary date must be entered when a lower limit has been given.",!,*7
GOTO UBDATE
+7 +8 ;IF "?" GIVE HELP AND RETURN TO LDATE PROMPT
+9 IF UDATE="?"
WRITE !!,"Give the upper boundary date for Management Report Printout [mm/dd/yy].",!
GOTO UBDATE
+10 +11 ;CHECK TO SEE IF A VALID DATE HAS BEEN ENTERED
+12 IF UDATE'?2N1"/"2N1"/"2N
WRITE !!,"Illegal date; check format and re-enter upper boundary date.",!,*7
GOTO UBDATE
+13 +14 ;CONVERT DATE (CONVERT)
+15 ;X = DATE TO CONVERT USING ^%DT
SET X=UDATE
+16 DO CONVERT
+17 ;DATE FORMAT WAS ILLEGAL
+18 IF Y<1
WRITE !!,"Illegal date; check format and re-enter upper boundary date.",!,*7
GOTO UBDATE
+19 SET UDATE=Y
+20 +21 ;CHECK TO SEE IF UDATE >= LDATE
+22 IF UDATE'>LDATE!UDATE=LDATE
WRITE !!,"Upper boundary date must be greater than or equal to lower boundary date.",!,*7
GOTO UBDATE
+23 +24 ;DO PRINTOUT; THEN QUIT
+25 DO ^%ZIS
USE IO
+26 DO PRINTOUT
+27 QUIT
+28 PRINTOUT ;PRINTOUT MANAGEMENT REPORT
+1 ;SUB-ROUTINES: PRINT2,PRINT3
+2 ;SNUM = SUPPORT NUMBER
SET SNUM=0
+3 ;AVERAGE TIME PER CALL PER SITE
SET TIME=0
+4 ;AVERAGE TIME PER CALL FOR ALL SITES
SET TTIME=0
+5 ;NUMBER OF CALLS PER SITE
SET CALLS=0
+6 ;NUMBER OF CALLS FOR ALL SITES
SET TCALLS=0
+7 ;INITIALIZE SITE TO FIRST IN DATABASE
SET SITE=1
+8 +9 ;CALL DEVICE
+10 ;D ^%ZIS U IO
+11 +12 ;SET Y TO LOWER DATE FOR REPORT OUTPUT
SET Y=LDATE
+13 ;CONVERT CURRENT DATE
DO DD^%DT
+14 ;REPORT LOWER DATE
SET LDATE1=Y
+15 ;SET Y TO UPPER DATE FOR REPORT OUTPUT
SET Y=UDATE
+16 ;CONVERT CURRENT DATE
DO DD^%DT
+17 ;REPORT UPPER DATE
SET UDATE1=Y
+18 ;CLEAR SCREEN WHEN OUTPUT TO TERMINAL
WRITE @IOF
+19 WRITE !,"________________________________________________________________________________",!
+20 WRITE !,"Management Time Report",?35,"For Period:",?48,LDATE1," - ",?63,UDATE1
+21 WRITE !!,"Service Unit",?31,"Number of Calls",?57,"Call Time in Hours"
+22 WRITE !,"________________________________________________________________________________",!
+23 PRINT2 ;SET UP TOTALS AND SITENAME
+1 ;SUB-ROUTINE OF PRINTOUT
+2 SET SNUM=$ORDER(^DIZ(FILE,"D",SITE,SNUM))
+3 IF SNUM'=""
IF ($PIECE(^DIZ(FILE,SNUM,0),U,4)'<LDATE)&($JUSTIFY($PIECE(^DIZ(FILE,SNUM,0),U,4),7,0)'>UDATE)
SET CALLS=CALLS+1
SET TIME=TIME+$PIECE(^DIZ(FILE,SNUM,5),U,2)
GOTO PRINT2
+4 IF SNUM'=""
GOTO PRINT2
+5 ;SET SITENAME USING SITE (NUMERIC)
DO SITELKUP
+6 ;PRINT SUB-TOTALS PER SITE
DO PRINT3
+7 ;GO TO NEXT SITE
SET SITE=$ORDER(^DIZ(FILE,"D",SITE))
+8 IF SITE'=""
SET TTIME=TTIME+TIME
SET TCALLS=TCALLS+CALLS
SET SNUM=0
SET TIME=0
SET CALLS=0
GOTO PRINT2
+9 +10 WRITE !!,"________________________________________________________________________________"
+11 ;******************HERE************
+12 SET TTIME=TTIME+TIME
+13 WRITE !!,?27,"Total Calls= ",$JUSTIFY(TCALLS,6),?56," Total Time= ",$JUSTIFY(TTIME/60,6,2)
+14 WRITE !!,"________________________________________________________________________________"
+15 IF $EXTRACT(IOST)="P"
WRITE @IOF
+16 DO ^%ZISC
+17 QUIT
+18 PRINT3 ;PRINTOUT EACH INDIVIDUAL SITES SUB-TOTALS IN HOURS
+1 ;SUB-ROUTINE OF PRINTOUT
+2 WRITE !!,SITENAME,?40,$JUSTIFY(CALLS,6),?69,$JUSTIFY(TIME/60,6,2)
+3 QUIT
+4 DEFAULT ;SET DEFAULT DATES TO INCLUDE ALL CURRENT LOGS
+1 ;SET TO EARLIER THAN EARLIEST POSSIBLE LOG DATE
SET LDATE="2920401"
+2 ;SET TO CURRENT DATE
SET UDATE=DT
+3 QUIT
+4 CONVERT ;CONVERT USER DATES TO FILEMAN DATE FORMAT
+1 ;SET LOCAL VARIABLES
+2 ;E=ECHO ANSWER;X=EXACT DATE;T=TIME ALLOWED, NOT REQUIRED
SET %DT="EXT"
+3 ;VALUE RETURNED IN Y
DO ^%DT
+4 QUIT
+5 SITELKUP ;SET SITENAME USING A LOOKUP IN SITES FILE
+1 ;SITENAME = 1ST PIECE IN SITES FILE DFN
+2 SET SITENAME=$PIECE(^DIZ(1991010,SITE,0),U,1)
+3 QUIT