ESPUCM ;DALISC/CKA -UNIFORM CRIME REPORT IN MAIL MESSAGE- 4/93
;;1.0;POLICE & SECURITY;**13**;Mar 31, 1994
EN ;
I '$D(DUZ(2)) W !,"Site # is not defined!" G EX
DATE ;ASK BEGINNING DATE
D DT^DICRW K BEGDATE
ASK ;ASK FOR CRIME DATA DATE TO PRINT
S DIC="^ESP(912.4,",DIC(0)="AEMQ",DIC("A")=" Beginning DATE of Report to Print : " D ^DIC
I Y<0 G EX
S ESPIEN=+Y
NDB ; ask about transmission to national database
N ESPFLG
D VADB
START ; BEGINS THE PRINT OF THIS CRIME REPORT
MM S ESPL=0,PAGE=0,SPACES=" ",IOM=79,IOSL=64
W !,"Mail message is now being created."
K ^UTILITY("DIQ1",$J),^TMP($J,"UCM") D HDR
S DIC="^ESP(912.4,",DA=ESPIEN,DR=".01;.02",DIQ(0)="E" D EN^DIQ1 I '$D(^UTILITY("DIQ1",$J,912.4,DA)) W !,"RECORD DOESN'T EXIST!" G EX
BDT S ESPX=$E(SPACES,1,45)_"BEGINNING DATE: "_$G(^UTILITY("DIQ1",$J,912.4,DA,.01,"E")) D MSG
EDT S ESPX=$E(SPACES,1,45)_"ENDING DATE: "_$G(^UTILITY("DIQ1",$J,912.4,DA,.02,"E")) D MSG
F ESPN=0:0 S ESPN=$O(^ESP(912.4,ESPIEN,1,ESPN)) Q:ESPN'>0 D PRT^ESPUCM1
EX K BEGDATE,DA,DIC,DIQ,DR,ESPIEN,ESPL,ESPN,ESPX,PAGE,SPACES,TOT,Y,^UTILITY("DIQ1",$J),^TMP($J,"UCM")
QUIT
HDR ;PRINT HEADING
S PAGE=PAGE+1 S ESPX=$E(SPACES,1,25)_"DEPARTMENT OF VETERANS AFFAIRS"_$E(SPACES,1,(IOM-65))_"PAGE: "_$J(PAGE,3) D MSG
S ESPX=$E(SPACES,1,35)_"VA POLICE" D MSG S ESPX=$E(SPACES,1,33)_"UNIFORM CRIME REPORT" D MSG
S ESPX=" " D MSG S ESPX="VA Facility "_$P(^ESP(912.4,ESPIEN,1,1,0),U) D MSG
QUIT
MSG S ^TMP($J,"UCM",ESPL)=ESPX,ESPL=ESPL+1
QUIT
VADB ; transmit to national database
N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
W !
S DIR("A")="Do you want to transmit this report to the National Database (XXX@Q-VAP.DOMAIN.EXT)",DIR("B")="NO",DIR(0)="Y"
D ^DIR
S ESPFLG=Y
W !
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPUCM 1793 printed Dec 13, 2024@02:30:34 Page 2
ESPUCM ;DALISC/CKA -UNIFORM CRIME REPORT IN MAIL MESSAGE- 4/93
+1 ;;1.0;POLICE & SECURITY;**13**;Mar 31, 1994
EN ;
+1 IF '$DATA(DUZ(2))
WRITE !,"Site # is not defined!"
GOTO EX
DATE ;ASK BEGINNING DATE
+1 DO DT^DICRW
KILL BEGDATE
ASK ;ASK FOR CRIME DATA DATE TO PRINT
+1 SET DIC="^ESP(912.4,"
SET DIC(0)="AEMQ"
SET DIC("A")=" Beginning DATE of Report to Print : "
DO ^DIC
+2 IF Y<0
GOTO EX
+3 SET ESPIEN=+Y
NDB ; ask about transmission to national database
+1 NEW ESPFLG
+2 DO VADB
START ; BEGINS THE PRINT OF THIS CRIME REPORT
MM SET ESPL=0
SET PAGE=0
SET SPACES=" "
SET IOM=79
SET IOSL=64
+1 WRITE !,"Mail message is now being created."
+2 KILL ^UTILITY("DIQ1",$JOB),^TMP($JOB,"UCM")
DO HDR
+3 SET DIC="^ESP(912.4,"
SET DA=ESPIEN
SET DR=".01;.02"
SET DIQ(0)="E"
DO EN^DIQ1
IF '$DATA(^UTILITY("DIQ1",$JOB,912.4,DA))
WRITE !,"RECORD DOESN'T EXIST!"
GOTO EX
BDT SET ESPX=$EXTRACT(SPACES,1,45)_"BEGINNING DATE: "_$GET(^UTILITY("DIQ1",$JOB,912.4,DA,.01,"E"))
DO MSG
EDT SET ESPX=$EXTRACT(SPACES,1,45)_"ENDING DATE: "_$GET(^UTILITY("DIQ1",$JOB,912.4,DA,.02,"E"))
DO MSG
+1 FOR ESPN=0:0
SET ESPN=$ORDER(^ESP(912.4,ESPIEN,1,ESPN))
if ESPN'>0
QUIT
DO PRT^ESPUCM1
EX KILL BEGDATE,DA,DIC,DIQ,DR,ESPIEN,ESPL,ESPN,ESPX,PAGE,SPACES,TOT,Y,^UTILITY("DIQ1",$JOB),^TMP($JOB,"UCM")
+1 QUIT
HDR ;PRINT HEADING
+1 SET PAGE=PAGE+1
SET ESPX=$EXTRACT(SPACES,1,25)_"DEPARTMENT OF VETERANS AFFAIRS"_$EXTRACT(SPACES,1,(IOM-65))_"PAGE: "_$JUSTIFY(PAGE,3)
DO MSG
+2 SET ESPX=$EXTRACT(SPACES,1,35)_"VA POLICE"
DO MSG
SET ESPX=$EXTRACT(SPACES,1,33)_"UNIFORM CRIME REPORT"
DO MSG
+3 SET ESPX=" "
DO MSG
SET ESPX="VA Facility "_$PIECE(^ESP(912.4,ESPIEN,1,1,0),U)
DO MSG
+4 QUIT
MSG SET ^TMP($JOB,"UCM",ESPL)=ESPX
SET ESPL=ESPL+1
+1 QUIT
VADB ; transmit to national database
+1 NEW DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+2 WRITE !
+3 SET DIR("A")="Do you want to transmit this report to the National Database (XXX@Q-VAP.DOMAIN.EXT)"
SET DIR("B")="NO"
SET DIR(0)="Y"
+4 DO ^DIR
+5 SET ESPFLG=Y
+6 WRITE !
+7 QUIT