Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ESPJOU

ESPJOU.m

Go to the documentation of this file.
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