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

ESPORM.m

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