ESPJOU ;DALISC/RWW - ENHANCED PRINT DAILY OPERATIONS JOURNAL;3/99
;;1.0;POLICE & SECURITY;**1,7,12,14,17,26,27,39,42**;Mar 31, 1994
EN ;
D DT^DICRW
JOU S DIC(0)="QAEMZ",DIC("A")="DATE: ",DIC="^ESP(916,"
D ^DIC
G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
I Y<0 W !,$C(7),"DATE not found. Please try again." G JOU
S ESPID=+Y
Q S %ZIS="Q" D ^%ZIS G:POP EXIT I '$D(IO("Q")) U IO D START G EXIT
S ZTRTN="START^ESPJOU",ZTSAVE("ESP*")="",ZTDESC="DAILY JOURNAL" D ^%ZTLOAD,HOME^%ZIS G EXIT
START ;BEGINS THE PRINT OF THE DAILY JOURNAL
N ESPFAC K ^UTILITY("DIQ1",$J)
S (END,PAGE)=0 D HDR G:END EXIT
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
SEC1 W !,?28,"SECTION I - PERIOD COVERED"
W !,?28 F I=1:1:26 W "="
S ESPF=$G(^UTILITY("DIQ1",$J,916,DA,1,"E")),ESPT=$G(^UTILITY("DIQ1",$J,916,DA,2,"E"))
DFM W !!,?19,"FROM: ",ESPF
DTO W ?43,"TO: ",ESPT
SEC2 I $Y+5>IOSL D HDR1 G:END EXIT
W !!,?29,"SECTION II - ASSIGNMENTS"
W !,?29 F I=1:1:24 W "="
W !
F ESPN=0:0 S ESPN=$O(^ESP(916,ESPID,2,ESPN)) Q:END Q:ESPN'>0 D
. 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"))
WATC . S (NAME,PDUZ)=""
. I $Y+5>IOSL D HDR1 Q:END
. W !,?15,$G(^UTILITY("DIQ1",$J,916.03,DA,.01,"E"))
. F ESPN1=0:0 S ESPN1=$O(^ESP(916,ESPID,2,ESPN,1,ESPN1)) Q:ESPN1'>0 D
.. 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"))
.. W ?27,$G(^UTILITY("DIQ1",$J,916.31,DA,.01,"E")),?55,$G(^UTILITY("DIQ1",$J,916.31,DA,.03,"E")),!
G:END EXIT
SEC3 K ^UTILITY($J,"W") S DIWL=7,DIWR=80,DIWF="W",IEN=0
I $Y+5>IOSL D HDR1 G:END EXIT
W !,?24,"SECTION III - SPECIAL INSTRUCTIONS"
W !,?24 F I=1:1:34 W "="
F ESPN=1:1 S IEN=$O(^ESP(916,ESPID,3,IEN)) Q:IEN'>0 S X=^(IEN,0) D Q:END
. I $Y+5>IOSL D HDR1 Q:END
. D ^DIWP
G:END EXIT
D ^DIWW
SEC4 D HDR4 G:END EXIT
I '$G(ESPJOU1) F ESPN=0:0 S ESPN=$O(^ESP(916,ESPID,4,ESPN)) Q:ESPN'>0 D TIME Q:END
I $G(ESPJOU1) D
. D SORT^ESPJOU1
. S ESPTI=""
. F S ESPTI=$O(^TMP($J,"ESP",ESPTI)) Q:ESPTI="" S ESPN=^(ESPTI) D TIME Q:END
G:END EXIT
I $Y+5>IOSL D HDR1 G:END EXIT
W !!!!!,?7,"REVIEW (Chief, Police Service)",!!
W ?7,"______________________________"
W ?45,"Date: _________________________"
D ^%ZISC
EXIT 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
K ^UTILITY("DIQ1",$J),^TMP($J)
QUIT
HDR ;PRINT HEADING
I PAGE S END=$$EOP^ESPUTIL Q:END W @IOF
E I $E(IOST,1,2)="C-" W @IOF
S PAGE=PAGE+1
W !!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$J(PAGE,3)
W !?26,"(Automated VA Form 10-1433)"
W !?4,"VA Facility" W ?61,"Date/Time Printed"
S ESPFAC=$P(^ESP(916,ESPID,0),U,2)
I +ESPFAC>0 W !?4,$P($G(^DG(40.8,ESPFAC,0)),U,1)
E W !?4,$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"")
W ?61,$$NOW^ESPUTIL()
QUIT
HDR1 ;PRINT CONSECUTIVE HEADERS
S END=$$EOP^ESPUTIL Q:END
S PAGE=PAGE+1 W @IOF,!!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$J(PAGE,3)
W !?25,"(Automated VA Form 10-1433a)"
W ?61,$$NOW^ESPUTIL()
W !!?18,"FROM: ",ESPF
W ?43,"TO: ",ESPT,!
QUIT
HDR4 ;SECTION 4 HEADING
I $Y+7>IOSL D HDR1 Q:END
W !,?28,"SECTION IV - ENTRY SUMMARY"
W !,?28 F I=1:1:26 W "="
W !!,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
W !,?4 F I=1:1:76 W "="
QUIT
HDR2 S X=""
W !,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
W !,?4 F I=1:1:76 W "="
QUIT
;
TIME ; print from time multiple of file 916
N NM
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"))
I $Y+5>IOSL D HDR1 Q:END D HDR2
W !,?4,$G(^UTILITY("DIQ1",$J,916.05,DA,.01,"E"))
S NM=^UTILITY("DIQ1",$J,916.05,DA,1,"E")
W ?14,$E($P(NM,","),1,5),",",$E($P(NM,",",2)),$J($E($P($P(NM,",",2)," ",2)),2)
W ?27,$G(^UTILITY("DIQ1",$J,916.05,DA,2,"E"))
K ^UTILITY($J,"W") S DIWL=7,DIWR=79,DIWF="W",IEN=0
F ESPN1=1:1 S IEN=$O(^ESP(916,ESPID,4,ESPN,3,IEN)) Q:IEN'>0 S X=^(IEN,0) D Q:END
. I $Y+5>IOSL D HDR1 Q:END
. D ^DIWP
Q:END
D ^DIWW
W ?4 F I=1:1:76 W "-"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPJOU 4275 printed Nov 22, 2024@17:39:43 Page 2
ESPJOU ;DALISC/RWW - ENHANCED PRINT DAILY OPERATIONS JOURNAL;3/99
+1 ;;1.0;POLICE & SECURITY;**1,7,12,14,17,26,27,39,42**;Mar 31, 1994
EN ;
+1 DO DT^DICRW
JOU SET DIC(0)="QAEMZ"
SET DIC("A")="DATE: "
SET DIC="^ESP(916,"
+1 DO ^DIC
+2 if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
+3 IF Y<0
WRITE !,$CHAR(7),"DATE not found. Please try again."
GOTO JOU
+4 SET ESPID=+Y
Q SET %ZIS="Q"
DO ^%ZIS
if POP
GOTO EXIT
IF '$DATA(IO("Q"))
USE IO
DO START
GOTO EXIT
+1 SET ZTRTN="START^ESPJOU"
SET ZTSAVE("ESP*")=""
SET ZTDESC="DAILY JOURNAL"
DO ^%ZTLOAD
DO HOME^%ZIS
GOTO EXIT
START ;BEGINS THE PRINT OF THE DAILY JOURNAL
+1 NEW ESPFAC
KILL ^UTILITY("DIQ1",$JOB)
+2 SET (END,PAGE)=0
DO HDR
if END
GOTO EXIT
+3 SET DIC="^ESP(916,"
SET DA=ESPID
SET DR="1;2;3;4;5"
SET DIQ(0)="E"
DO EN^DIQ1
IF '$DATA(^UTILITY("DIQ1",$JOB,916,DA))
WRITE !,"RECORD DOESN'T EXIST!"
GOTO EXIT
SEC1 WRITE !,?28,"SECTION I - PERIOD COVERED"
+1 WRITE !,?28
FOR I=1:1:26
WRITE "="
+2 SET ESPF=$GET(^UTILITY("DIQ1",$JOB,916,DA,1,"E"))
SET ESPT=$GET(^UTILITY("DIQ1",$JOB,916,DA,2,"E"))
DFM WRITE !!,?19,"FROM: ",ESPF
DTO WRITE ?43,"TO: ",ESPT
SEC2 IF $Y+5>IOSL
DO HDR1
if END
GOTO EXIT
+1 WRITE !!,?29,"SECTION II - ASSIGNMENTS"
+2 WRITE !,?29
FOR I=1:1:24
WRITE "="
+3 WRITE !
+4 FOR ESPN=0:0
SET ESPN=$ORDER(^ESP(916,ESPID,2,ESPN))
if END
QUIT
if ESPN'>0
QUIT
Begin DoDot:1
+5 SET DIC="^ESP(916,"_ESPID_",2,"
SET DA=ESPN
SET DR=".01"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,916.03,DA,.01,"E"))
QUIT
WATC SET (NAME,PDUZ)=""
+1 IF $Y+5>IOSL
DO HDR1
if END
QUIT
+2 WRITE !,?15,$GET(^UTILITY("DIQ1",$JOB,916.03,DA,.01,"E"))
+3 FOR ESPN1=0:0
SET ESPN1=$ORDER(^ESP(916,ESPID,2,ESPN,1,ESPN1))
if ESPN1'>0
QUIT
Begin DoDot:2
+4 SET DIC="^ESP(916,"_ESPID_",2,"_ESPN_",1,"
SET DA=ESPN1
SET DR=".01;.03"
SET DIQ(0)="EI"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,916.31,DA,.01,"E"))
QUIT
+5 WRITE ?27,$GET(^UTILITY("DIQ1",$JOB,916.31,DA,.01,"E")),?55,$GET(^UTILITY("DIQ1",$JOB,916.31,DA,.03,"E")),!
End DoDot:2
End DoDot:1
+6 if END
GOTO EXIT
SEC3 KILL ^UTILITY($JOB,"W")
SET DIWL=7
SET DIWR=80
SET DIWF="W"
SET IEN=0
+1 IF $Y+5>IOSL
DO HDR1
if END
GOTO EXIT
+2 WRITE !,?24,"SECTION III - SPECIAL INSTRUCTIONS"
+3 WRITE !,?24
FOR I=1:1:34
WRITE "="
+4 FOR ESPN=1:1
SET IEN=$ORDER(^ESP(916,ESPID,3,IEN))
if IEN'>0
QUIT
SET X=^(IEN,0)
Begin DoDot:1
+5 IF $Y+5>IOSL
DO HDR1
if END
QUIT
+6 DO ^DIWP
End DoDot:1
if END
QUIT
+7 if END
GOTO EXIT
+8 DO ^DIWW
SEC4 DO HDR4
if END
GOTO EXIT
+1 IF '$GET(ESPJOU1)
FOR ESPN=0:0
SET ESPN=$ORDER(^ESP(916,ESPID,4,ESPN))
if ESPN'>0
QUIT
DO TIME
if END
QUIT
+2 IF $GET(ESPJOU1)
Begin DoDot:1
+3 DO SORT^ESPJOU1
+4 SET ESPTI=""
+5 FOR
SET ESPTI=$ORDER(^TMP($JOB,"ESP",ESPTI))
if ESPTI=""
QUIT
SET ESPN=^(ESPTI)
DO TIME
if END
QUIT
End DoDot:1
+6 if END
GOTO EXIT
+7 IF $Y+5>IOSL
DO HDR1
if END
GOTO EXIT
+8 WRITE !!!!!,?7,"REVIEW (Chief, Police Service)",!!
+9 WRITE ?7,"______________________________"
+10 WRITE ?45,"Date: _________________________"
+11 DO ^%ZISC
EXIT KILL 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
+1 KILL ^UTILITY("DIQ1",$JOB),^TMP($JOB)
+2 QUIT
HDR ;PRINT HEADING
+1 IF PAGE
SET END=$$EOP^ESPUTIL
if END
QUIT
WRITE @IOF
+2 IF '$TEST
IF $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+3 SET PAGE=PAGE+1
+4 WRITE !!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$JUSTIFY(PAGE,3)
+5 WRITE !?26,"(Automated VA Form 10-1433)"
+6 WRITE !?4,"VA Facility"
WRITE ?61,"Date/Time Printed"
+7 SET ESPFAC=$PIECE(^ESP(916,ESPID,0),U,2)
+8 IF +ESPFAC>0
WRITE !?4,$PIECE($GET(^DG(40.8,ESPFAC,0)),U,1)
+9 IF '$TEST
WRITE !?4,$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"")
+10 WRITE ?61,$$NOW^ESPUTIL()
+11 QUIT
HDR1 ;PRINT CONSECUTIVE HEADERS
+1 SET END=$$EOP^ESPUTIL
if END
QUIT
+2 SET PAGE=PAGE+1
WRITE @IOF,!!!?22,"VA POLICE DAILY OPERATIONS JOURNAL",?70,"Page ",$JUSTIFY(PAGE,3)
+3 WRITE !?25,"(Automated VA Form 10-1433a)"
+4 WRITE ?61,$$NOW^ESPUTIL()
+5 WRITE !!?18,"FROM: ",ESPF
+6 WRITE ?43,"TO: ",ESPT,!
+7 QUIT
HDR4 ;SECTION 4 HEADING
+1 IF $Y+7>IOSL
DO HDR1
if END
QUIT
+2 WRITE !,?28,"SECTION IV - ENTRY SUMMARY"
+3 WRITE !,?28
FOR I=1:1:26
WRITE "="
+4 WRITE !!,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
+5 WRITE !,?4
FOR I=1:1:76
WRITE "="
+6 QUIT
HDR2 SET X=""
+1 WRITE !,?4,"TIME",?14,"OFFICER",?27,"ACTIVITY"
+2 WRITE !,?4
FOR I=1:1:76
WRITE "="
+3 QUIT
+4 ;
TIME ; print from time multiple of file 916
+1 NEW NM
+2 SET DIC="^ESP(916,"_ESPID_",4,"
SET DA=ESPN
SET DR=".01;1;2"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,916.05,DA,.01,"E"))
QUIT
+3 IF $Y+5>IOSL
DO HDR1
if END
QUIT
DO HDR2
+4 WRITE !,?4,$GET(^UTILITY("DIQ1",$JOB,916.05,DA,.01,"E"))
+5 SET NM=^UTILITY("DIQ1",$JOB,916.05,DA,1,"E")
+6 WRITE ?14,$EXTRACT($PIECE(NM,","),1,5),",",$EXTRACT($PIECE(NM,",",2)),$JUSTIFY($EXTRACT($PIECE($PIECE(NM,",",2)," ",2)),2)
+7 WRITE ?27,$GET(^UTILITY("DIQ1",$JOB,916.05,DA,2,"E"))
+8 KILL ^UTILITY($JOB,"W")
SET DIWL=7
SET DIWR=79
SET DIWF="W"
SET IEN=0
+9 FOR ESPN1=1:1
SET IEN=$ORDER(^ESP(916,ESPID,4,ESPN,3,IEN))
if IEN'>0
QUIT
SET X=^(IEN,0)
Begin DoDot:1
+10 IF $Y+5>IOSL
DO HDR1
if END
QUIT
+11 DO ^DIWP
End DoDot:1
if END
QUIT
+12 if END
QUIT
+13 DO ^DIWW
+14 WRITE ?4
FOR I=1:1:76
WRITE "-"
+15 QUIT