source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPWR.m@ 1006

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1ESPWR ;DALISC/CKA - WORKLOAD REPORT- 3/93
2 ;;1.0;POLICE & SECURITY;**17,33**;Mar 31, 1994
3START ;
4 S ESPALL=0
5SELOFF S DIR(0)="FO^3:30",DIR("A")="Select OFFICER",DIR("B")="ALL" D ^DIR
6 I X="^" G EX
7 I Y="ALL" S ESPALL=1 G DATE
8 I $D(DTOUT) W $C(7) G EX
9 S DIC="^VA(200,",DIC(0)="EMQZ",D="AK.ESP POLICE"
10 D IX^DIC
11 I Y=-1 W !,$C(7),"This officer is not a current police officer." G SELOFF
12 S ESPPO=Y
13DATE ;ASK BEGINNING & ENDING DATE
14 D DT^DICRW K BEGDATE,ENDDATE W !!,"**** Date Range Selection ****",!
15 S %DT="AE",%DT(0)="-NOW",%DT("A")=" Beginning DATE : " D ^%DT K %DT
16 G:Y<0 EX
17 S (BEGDATE,ESPBD)=Y
18 W ! S %DT="AE",%DT("A")=" Ending DATE: " D ^%DT
19 G:$D(DTOUT) EX
20 G:Y<ESPBD HELP W ! S ENDDATE=Y,ESPED=Y+.9
21ZERO S ESPI=0 F ESPX=1:1 S ESPI=$O(^ESP(911,ESPI)) Q:ESPI'>0 S ESPC(ESPI)=0,ESPMIN(ESPI)=0
22COUNT ;GO THROUGH "B" X-REF TO COUNT AND GET TOTALS
23 I 'ESPALL G ONE
24 S ESPDT=ESPBD-.0005
25 F ESPI=1:1 S ESPDT=$O(^ESP(910.1,"B",ESPDT)) Q:ESPDT>ESPED!(ESPDT'>0) D
26 . S ESPIEN=0
27 . F ESPJ=1:1 S ESPIEN=$O(^ESP(910.1,"B",ESPDT,ESPIEN)) Q:ESPIEN'>0 D
28 .. S ESPOFF=0
29 .. F ESPZ=1:1 S ESPOFF=$O(^ESP(910.1,ESPIEN,10,ESPOFF)) Q:ESPOFF'>0 D
30 ... ;COUNT AND GET TOTALS
31 ... S ESPACT=0
32 ... F ESPY=1:1 S ESPACT=$O(^ESP(910.1,ESPIEN,10,ESPOFF,10,ESPACT)) Q:ESPACT'>0 D
33 .... S ESPI=$P(^ESP(910.1,ESPIEN,10,ESPOFF,10,ESPACT,0),U) I $D(ESPC(ESPI)) S ESPC(ESPI)=ESPC(ESPI)+$P(^(0),U,2),ESPMIN(ESPI)=ESPMIN(ESPI)+$P(^(0),U,3)
34 G PRT
35ONE ;ONLY ONE OFFICER
36 S ESPDT=ESPBD-.0005
37 F ESPI=1:1 S ESPDT=$O(^ESP(910.1,"B",ESPDT)) Q:ESPDT>ESPED!(ESPDT'>0) D
38 . S ESPIEN=0
39 . F ESPJ=1:1 S ESPIEN=$O(^ESP(910.1,"B",ESPDT,ESPIEN)) Q:ESPIEN'>0 D
40 .. S ESPOFF=0
41 .. F ESPZ=1:1 S ESPOFF=$O(^ESP(910.1,ESPIEN,10,ESPOFF)) Q:ESPOFF'>0 D:+ESPPO=$P(^ESP(910.1,ESPIEN,10,ESPOFF,0),U)
42 ... ;COUNT AND GET TOTALS
43 ... S ESPACT=0
44 ... F ESPY=1:1 S ESPACT=$O(^ESP(910.1,ESPIEN,10,ESPOFF,10,ESPACT)) Q:ESPACT'>0 D
45 .... S ESPI=$P(^ESP(910.1,ESPIEN,10,ESPOFF,10,ESPACT,0),U) I $D(ESPC(ESPI)) S ESPC(ESPI)=ESPC(ESPI)+$P(^(0),U,2),ESPMIN(ESPI)=ESPMIN(ESPI)+$P(^(0),U,3)
46PRT ;PRINT REPORT
47Q S %ZIS="Q" D ^%ZIS G:POP EX I '$D(IO("Q")) U IO D PRT^ESPWR1 G EX
48 S ZTRTN="PRT^ESPWR1",ZTSAVE("ESP*")="",ZTDESC="WORKLOAD REPORT" D ^%ZTLOAD,HOME^%ZIS G EX
49 W !!,"Done."
50EX D ^%ZISC
51 W:$D(DTOUT) $C(7)
52 K %ZIS,%DT,BEGDATE,CODE,DIC,DIR,END,ENDDATE,ESPACT,ESPALL,ESPBD,ESPC,ESPDT,ESPED,ESPI,ESPIEN,ESPJ,ESPMIN,ESPN,ESPPO,ESPOFF,ESPX,ESPY,ESPZ,NAM,OFNAM,PAGE,X,Y
53 QUIT
54 ;
55HELP W "??",!?5,"Ending date must not be before beginning date" G DATE
Note: See TracBrowser for help on using the repository browser.