source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPORM.m

Last change on this file was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1ESPORM ;DALISC/CKA - SEND OFFENSE REPORT IN MAIL MESSAGE;3/93
2 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
3EN ;Entry point to print only completed and nonsensitive reports.
4 D DT^DICRW
5OR 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,"
6 D ^DIC
7 G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
8 I Y<0 W !,$C(7),"UOR# not found. Please try again." G OR
9 S ESPDTR=$P(^ESP(912,+Y,0),U,2),ESPID=+Y
10START ; BEGINS THE PRINT OF THIS OFFENSE REPORT
11MM S ESPL=0,PAGE=0,SPACES=" ",IOM=80,IOSL=64
12 W !,"Mail message is now being created." K ^UTILITY("DIQ1",$J),^TMP($J,"UORM") D HDR
13 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
14DTR S ESPX="DATE/TIME RECEIVED: "_$G(^UTILITY("DIQ1",$J,912,DA,.02,"E")) D MSG
15DTO S ESPX="DATE/TIME OF OFFENSE: "_$G(^UTILITY("DIQ1",$J,912,DA,.03,"E")) D MSG
16EDTO S ESPX="ENDING DATE/TIME OF OFFENSE: "_$G(^UTILITY("DIQ1",$J,912,DA,.09,"E")) D MSG
17LOC S ESPX="LOCATION: "_$G(^UTILITY("DIQ1",$J,912,DA,.04,"E")) D MSG
18WEAP S ESPX="WEAPON USED: "_$G(^UTILITY("DIQ1",$J,912,DA,.05,"E")) D MSG
19PO S ESPX="INVESTIGATING OFFICER: "_$G(^UTILITY("DIQ1",$J,912,DA,.06,"E")) D MSG
20MO S IEN=0,ESPX="METHOD OF OPERATION: " D MSG S ESPX=" " D MSG
21 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
22 S ESPX=" " D MSG
23CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
24 F ESPN=0:0 S ESPN=$O(^ESP(912,ESPID,10,ESPN)) Q:ESPN'>0 D
25 . 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"))
26 . S ESPX="CLASSIFICATION CODE: "_$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
27 . I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" S ESPX=ESPX_"/"_^("E")
28 . I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" S ESPX=ESPX_"/"_^("E")
29 D MSG
30 G ^ESPORM1
31EXIT K DA,DIC,DIQ,DIRUT,DR,DTOUT,DUOUT,ESPDTR,ESPI,ESPID,ESPL,ESPN,ESPX,IEN,PAGE,SPACES,X,Y
32 K ^UTILITY("DIQ1",$J),^TMP($J,"UORM")
33 QUIT
34HDR ;PRINT HEADING
35 S PAGE=PAGE+1 S ESPX=$E(SPACES,1,25)_"DEPARTMENT OF VETERANS AFFAIRS"_$E(SPACES,1,IOM-10)_"PAGE: "_$J(PAGE,3)
36 D MSG
37 S ESPX=$E(SPACES,1,35)_"VA POLICE" D MSG
38 S ESPX=$E(SPACES,1,28)_"UNIFORM OFFENSE REPORT"
39 D MSG
40 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)
41 D MSG
42 S ESPX="VA Facility" D MSG
43 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
44 S ESPX="Automated VA Form 10-1393" D MSG
45 F ESPI=1:1:2 S ESPX=" " D MSG
46 QUIT
47 ;
48 ;ENTRY POINT OR1 ALLOWS PRINT OF AN INCOMPLETE REPORT
49 ;THIS OPTION IS ONLY FOR PERSONS HOLDING THE CHIEF KEY
50OR1 S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,5)",DIC="^ESP(912,"
51 D ^DIC G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT G:Y<0 OR1 S ESPDTR=$P(^ESP(912,+Y,0),U,2),ESPID=+Y
52 D START
53 QUIT
54MSG S ^TMP($J,"UORM",ESPL)=ESPX,ESPL=ESPL+1
55 QUIT
Note: See TracBrowser for help on using the repository browser.