ESPORM ;DALISC/CKA - SEND OFFENSE REPORT IN MAIL MESSAGE;3/93
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;Entry point to print only completed and nonsensitive reports.
D DT^DICRW
OR S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,2),'$P(^(5),U,4),$P(^(5),U,5)",DIC="^ESP(912,"
D ^DIC
G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
I Y<0 W !,$C(7),"UOR# not found. Please try again." G OR
S ESPDTR=$P(^ESP(912,+Y,0),U,2),ESPID=+Y
START ; BEGINS THE PRINT OF THIS OFFENSE REPORT
MM S ESPL=0,PAGE=0,SPACES=" ",IOM=80,IOSL=64
W !,"Mail message is now being created." K ^UTILITY("DIQ1",$J),^TMP($J,"UORM") D HDR
S DIC="^ESP(912,",DA=ESPID,DR=".02;.03;.04;.05;.06;.09",DIQ(0)="E" D EN^DIQ1 I '$D(^UTILITY("DIQ1",$J,912,DA)) W !,"RECORD DOESN'T EXIST!" G EXIT
DTR S ESPX="DATE/TIME RECEIVED: "_$G(^UTILITY("DIQ1",$J,912,DA,.02,"E")) D MSG
DTO S ESPX="DATE/TIME OF OFFENSE: "_$G(^UTILITY("DIQ1",$J,912,DA,.03,"E")) D MSG
EDTO S ESPX="ENDING DATE/TIME OF OFFENSE: "_$G(^UTILITY("DIQ1",$J,912,DA,.09,"E")) D MSG
LOC S ESPX="LOCATION: "_$G(^UTILITY("DIQ1",$J,912,DA,.04,"E")) D MSG
WEAP S ESPX="WEAPON USED: "_$G(^UTILITY("DIQ1",$J,912,DA,.05,"E")) D MSG
PO S ESPX="INVESTIGATING OFFICER: "_$G(^UTILITY("DIQ1",$J,912,DA,.06,"E")) D MSG
MO S IEN=0,ESPX="METHOD OF OPERATION: " D MSG S ESPX=" " D MSG
F ESPN=1:1 S IEN=$O(^ESP(912,ESPID,60,IEN)) Q:IEN'>0 S ESPX=$E(SPACES,1,7)_^(IEN,0) D MSG
S ESPX=" " D MSG
CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
F ESPN=0:0 S ESPN=$O(^ESP(912,ESPID,10,ESPN)) Q:ESPN'>0 D
. S DIC="^ESP(912,"_ESPID_",10,",DA=ESPN,DR=".01;.02;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
. S ESPX="CLASSIFICATION CODE: "_$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
. I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" S ESPX=ESPX_"/"_^("E")
. I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" S ESPX=ESPX_"/"_^("E")
D MSG
G ^ESPORM1
EXIT K DA,DIC,DIQ,DIRUT,DR,DTOUT,DUOUT,ESPDTR,ESPI,ESPID,ESPL,ESPN,ESPX,IEN,PAGE,SPACES,X,Y
K ^UTILITY("DIQ1",$J),^TMP($J,"UORM")
QUIT
HDR ;PRINT HEADING
S PAGE=PAGE+1 S ESPX=$E(SPACES,1,25)_"DEPARTMENT OF VETERANS AFFAIRS"_$E(SPACES,1,IOM-10)_"PAGE: "_$J(PAGE,3)
D MSG
S ESPX=$E(SPACES,1,35)_"VA POLICE" D MSG
S ESPX=$E(SPACES,1,28)_"UNIFORM OFFENSE REPORT"
D MSG
S ESPX=$E(SPACES,1,30)_"UOR# "_$E(ESPDTR,2,3)_"-"_$E(ESPDTR,4,5)_"-"_$E(ESPDTR,6,7)_"-"_$TR($E($P(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
D MSG
S ESPX="VA Facility" D MSG
I $D(^ESP(912,ESPID,5)),$P(^(5),U)'="" S ESPX=$S($D(^DIC(4,$P(^(5),U),0)):$P(^(0),U),1:"") D MSG
S ESPX="Automated VA Form 10-1393" D MSG
F ESPI=1:1:2 S ESPX=" " D MSG
QUIT
;
;ENTRY POINT OR1 ALLOWS PRINT OF AN INCOMPLETE REPORT
;THIS OPTION IS ONLY FOR PERSONS HOLDING THE CHIEF KEY
OR1 S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,5)",DIC="^ESP(912,"
D ^DIC G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT G:Y<0 OR1 S ESPDTR=$P(^ESP(912,+Y,0),U,2),ESPID=+Y
D START
QUIT
MSG S ^TMP($J,"UORM",ESPL)=ESPX,ESPL=ESPL+1
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPORM 3079 printed Dec 13, 2024@02:30 Page 2
ESPORM ;DALISC/CKA - SEND OFFENSE REPORT IN MAIL MESSAGE;3/93
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;Entry point to print only completed and nonsensitive reports.
+1 DO DT^DICRW
OR SET DIC(0)="QAEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),$P(^(5),U,2),'$P(^(5),U,4),$P(^(5),U,5)"
SET DIC="^ESP(912,"
+1 DO ^DIC
+2 if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
+3 IF Y<0
WRITE !,$CHAR(7),"UOR# not found. Please try again."
GOTO OR
+4 SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET ESPID=+Y
START ; BEGINS THE PRINT OF THIS OFFENSE REPORT
MM SET ESPL=0
SET PAGE=0
SET SPACES=" "
SET IOM=80
SET IOSL=64
+1 WRITE !,"Mail message is now being created."
KILL ^UTILITY("DIQ1",$JOB),^TMP($JOB,"UORM")
DO HDR
+2 SET DIC="^ESP(912,"
SET DA=ESPID
SET DR=".02;.03;.04;.05;.06;.09"
SET DIQ(0)="E"
DO EN^DIQ1
IF '$DATA(^UTILITY("DIQ1",$JOB,912,DA))
WRITE !,"RECORD DOESN'T EXIST!"
GOTO EXIT
DTR SET ESPX="DATE/TIME RECEIVED: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.02,"E"))
DO MSG
DTO SET ESPX="DATE/TIME OF OFFENSE: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.03,"E"))
DO MSG
EDTO SET ESPX="ENDING DATE/TIME OF OFFENSE: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.09,"E"))
DO MSG
LOC SET ESPX="LOCATION: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.04,"E"))
DO MSG
WEAP SET ESPX="WEAPON USED: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.05,"E"))
DO MSG
PO SET ESPX="INVESTIGATING OFFICER: "_$GET(^UTILITY("DIQ1",$JOB,912,DA,.06,"E"))
DO MSG
MO SET IEN=0
SET ESPX="METHOD OF OPERATION: "
DO MSG
SET ESPX=" "
DO MSG
+1 FOR ESPN=1:1
SET IEN=$ORDER(^ESP(912,ESPID,60,IEN))
if IEN'>0
QUIT
SET ESPX=$EXTRACT(SPACES,1,7)_^(IEN,0)
DO MSG
+2 SET ESPX=" "
DO MSG
CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
+1 FOR ESPN=0:0
SET ESPN=$ORDER(^ESP(912,ESPID,10,ESPN))
if ESPN'>0
QUIT
Begin DoDot:1
+2 SET DIC="^ESP(912,"_ESPID_",10,"
SET DA=ESPN
SET DR=".01;.02;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
QUIT
+3 SET ESPX="CLASSIFICATION CODE: "_$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+4 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
SET ESPX=ESPX_"/"_^("E")
+5 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.03,"E"))]""
SET ESPX=ESPX_"/"_^("E")
End DoDot:1
+6 DO MSG
+7 GOTO ^ESPORM1
EXIT KILL DA,DIC,DIQ,DIRUT,DR,DTOUT,DUOUT,ESPDTR,ESPI,ESPID,ESPL,ESPN,ESPX,IEN,PAGE,SPACES,X,Y
+1 KILL ^UTILITY("DIQ1",$JOB),^TMP($JOB,"UORM")
+2 QUIT
HDR ;PRINT HEADING
+1 SET PAGE=PAGE+1
SET ESPX=$EXTRACT(SPACES,1,25)_"DEPARTMENT OF VETERANS AFFAIRS"_$EXTRACT(SPACES,1,IOM-10)_"PAGE: "_$JUSTIFY(PAGE,3)
+2 DO MSG
+3 SET ESPX=$EXTRACT(SPACES,1,35)_"VA POLICE"
DO MSG
+4 SET ESPX=$EXTRACT(SPACES,1,28)_"UNIFORM OFFENSE REPORT"
+5 DO MSG
+6 SET ESPX=$EXTRACT(SPACES,1,30)_"UOR# "_$EXTRACT(ESPDTR,2,3)_"-"_$EXTRACT(ESPDTR,4,5)_"-"_$EXTRACT(ESPDTR,6,7)_"-"_$TRANSLATE($EXTRACT($PIECE(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
+7 DO MSG
+8 SET ESPX="VA Facility"
DO MSG
+9 IF $DATA(^ESP(912,ESPID,5))
IF $PIECE(^(5),U)'=""
SET ESPX=$SELECT($DATA(^DIC(4,$PIECE(^(5),U),0)):$PIECE(^(0),U),1:"")
DO MSG
+10 SET ESPX="Automated VA Form 10-1393"
DO MSG
+11 FOR ESPI=1:1:2
SET ESPX=" "
DO MSG
+12 QUIT
+13 ;
+14 ;ENTRY POINT OR1 ALLOWS PRINT OF AN INCOMPLETE REPORT
+15 ;THIS OPTION IS ONLY FOR PERSONS HOLDING THE CHIEF KEY
OR1 SET DIC(0)="QAEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),$P(^(5),U,5)"
SET DIC="^ESP(912,"
+1 DO ^DIC
if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
if Y<0
GOTO OR1
SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET ESPID=+Y
+2 DO START
+3 QUIT
MSG SET ^TMP($JOB,"UORM",ESPL)=ESPX
SET ESPL=ESPL+1
+1 QUIT