source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPJOU.m@ 619

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1ESPJOU ;DALISC/RWW - ENHANCED PRINT DAILY OPERATIONS JOURNAL;3/99
2 ;;1.0;POLICE & SECURITY;**1,7,12,14,17,26,27,39,42**;Mar 31, 1994
3EN ;
4 D DT^DICRW
5JOU S DIC(0)="QAEMZ",DIC("A")="DATE: ",DIC="^ESP(916,"
6 D ^DIC
7 G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
8 I Y<0 W !,$C(7),"DATE not found. Please try again." G JOU
9 S ESPID=+Y
10Q S %ZIS="Q" D ^%ZIS G:POP EXIT I '$D(IO("Q")) U IO D START G EXIT
11 S ZTRTN="START^ESPJOU",ZTSAVE("ESP*")="",ZTDESC="DAILY JOURNAL" D ^%ZTLOAD,HOME^%ZIS G EXIT
12START ;BEGINS THE PRINT OF THE DAILY JOURNAL
13 N ESPFAC K ^UTILITY("DIQ1",$J)
14 S (END,PAGE)=0 D HDR G:END EXIT
15 S DIC="^ESP(916,",DA=ESPID,DR="1;2;3;4;5",DIQ(0)="E" D EN^DIQ1 I '$D(^UTILITY("DIQ1",$J,916,DA)) W !,"RECORD DOESN'T EXIST!" G EXIT
16SEC1 W !,?28,"SECTION I - PERIOD COVERED"
17 W !,?28 F I=1:1:26 W "="
18 S ESPF=$G(^UTILITY("DIQ1",$J,916,DA,1,"E")),ESPT=$G(^UTILITY("DIQ1",$J,916,DA,2,"E"))
19DFM W !!,?19,"FROM: ",ESPF
20DTO W ?43,"TO: ",ESPT
21SEC2 I $Y+5>IOSL D HDR1 G:END EXIT
22 W !!,?29,"SECTION II - ASSIGNMENTS"
23 W !,?29 F I=1:1:24 W "="
24 W !
25 F ESPN=0:0 S ESPN=$O(^ESP(916,ESPID,2,ESPN)) Q:END Q:ESPN'>0 D
26 . S DIC="^ESP(916,"_ESPID_",2,",DA=ESPN,DR=".01",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,916.03,DA,.01,"E"))
27WATC . S (NAME,PDUZ)=""
28 . I $Y+5>IOSL D HDR1 Q:END
29 . W !,?15,$G(^UTILITY("DIQ1",$J,916.03,DA,.01,"E"))
30 . F ESPN1=0:0 S ESPN1=$O(^ESP(916,ESPID,2,ESPN,1,ESPN1)) Q:ESPN1'>0 D
31 .. S DIC="^ESP(916,"_ESPID_",2,"_ESPN_",1,",DA=ESPN1,DR=".01;.03",DIQ(0)="EI" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,916.31,DA,.01,"E"))
32 .. W ?27,$G(^UTILITY("DIQ1",$J,916.31,DA,.01,"E")),?55,$G(^UTILITY("DIQ1",$J,916.31,DA,.03,"E")),!
33 G:END EXIT
34SEC3 K ^UTILITY($J,"W") S DIWL=7,DIWR=80,DIWF="W",IEN=0
35 I $Y+5>IOSL D HDR1 G:END EXIT
36 W !,?24,"SECTION III - SPECIAL INSTRUCTIONS"
37 W !,?24 F I=1:1:34 W "="
38 F ESPN=1:1 S IEN=$O(^ESP(916,ESPID,3,IEN)) Q:IEN'>0 S X=^(IEN,0) D Q:END
39 . I $Y+5>IOSL D HDR1 Q:END
40 . D ^DIWP
41 G:END EXIT
42 D ^DIWW
43SEC4 D HDR4 G:END EXIT
44 I '$G(ESPJOU1) F ESPN=0:0 S ESPN=$O(^ESP(916,ESPID,4,ESPN)) Q:ESPN'>0 D TIME Q:END
45 I $G(ESPJOU1) D
46 . D SORT^ESPJOU1
47 . S ESPTI=""
48 . F S ESPTI=$O(^TMP($J,"ESP",ESPTI)) Q:ESPTI="" S ESPN=^(ESPTI) D TIME Q:END
49 G:END EXIT
50 I $Y+5>IOSL D HDR1 G:END EXIT
51 W !!!!!,?7,"REVIEW (Chief, Police Service)",!!
52 W ?7,"______________________________"
53 W ?45,"Date: _________________________"
54 D ^%ZISC
55EXIT K CL,DA,DIC,DIQ,DIR,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,DUOUT,END,ESPID,ESPN,ESPN1,ESPF,ESPT,ESPTI,ESPTIME,IEN,NAME,PAGE,PDUZ,X,Y,ZTDESC,ZTRTN,ZTSAVE,%ZIS,%,I,POP
56 K ^UTILITY("DIQ1",$J),^TMP($J)
57 QUIT
58HDR ;PRINT HEADING
59 I PAGE S END=$$EOP^ESPUTIL Q:END W @IOF
60 E I $E(IOST,1,2)="C-" W @IOF
61 S PAGE=PAGE+1
62 W !!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$J(PAGE,3)
63 W !?26,"(Automated VA Form 10-1433)"
64 W !?4,"VA Facility" W ?61,"Date/Time Printed"
65 S ESPFAC=$P(^ESP(916,ESPID,0),U,2)
66 I +ESPFAC>0 W !?4,$P($G(^DG(40.8,ESPFAC,0)),U,1)
67 E W !?4,$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"")
68 W ?61,$$NOW^ESPUTIL()
69 QUIT
70HDR1 ;PRINT CONSECUTIVE HEADERS
71 S END=$$EOP^ESPUTIL Q:END
72 S PAGE=PAGE+1 W @IOF,!!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$J(PAGE,3)
73 W !?25,"(Automated VA Form 10-1433a)"
74 W ?61,$$NOW^ESPUTIL()
75 W !!?18,"FROM: ",ESPF
76 W ?43,"TO: ",ESPT,!
77 QUIT
78HDR4 ;SECTION 4 HEADING
79 I $Y+7>IOSL D HDR1 Q:END
80 W !,?28,"SECTION IV - ENTRY SUMMARY"
81 W !,?28 F I=1:1:26 W "="
82 W !!,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
83 W !,?4 F I=1:1:76 W "="
84 QUIT
85HDR2 S X=""
86 W !,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
87 W !,?4 F I=1:1:76 W "="
88 QUIT
89 ;
90TIME ; print from time multiple of file 916
91 N NM
92 S DIC="^ESP(916,"_ESPID_",4,",DA=ESPN,DR=".01;1;2",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,916.05,DA,.01,"E"))
93 I $Y+5>IOSL D HDR1 Q:END D HDR2
94 W !,?4,$G(^UTILITY("DIQ1",$J,916.05,DA,.01,"E"))
95 S NM=^UTILITY("DIQ1",$J,916.05,DA,1,"E")
96 W ?14,$E($P(NM,","),1,5),",",$E($P(NM,",",2)),$J($E($P($P(NM,",",2)," ",2)),2)
97 W ?27,$G(^UTILITY("DIQ1",$J,916.05,DA,2,"E"))
98 K ^UTILITY($J,"W") S DIWL=7,DIWR=79,DIWF="W",IEN=0
99 F ESPN1=1:1 S IEN=$O(^ESP(916,ESPID,4,ESPN,3,IEN)) Q:IEN'>0 S X=^(IEN,0) D Q:END
100 . I $Y+5>IOSL D HDR1 Q:END
101 . D ^DIWP
102 Q:END
103 D ^DIWW
104 W ?4 F I=1:1:76 W "-"
105 Q
Note: See TracBrowser for help on using the repository browser.