source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPORP.m@ 1133

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1ESPORP ;DALISC/CKA - PRINT OFFENSE REPORT;3/99
2 ;;1.0;POLICE & SECURITY;**14,17,27,36,39,42**;Mar 31, 1994
3EN ;Entry point to print only completed and nonsensitive reports.
4 D DT^DICRW
5OR S DIC(0)="AEMZ",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
10Q S %ZIS="Q" D ^%ZIS G:POP EXIT I '$D(IO("Q")) U IO D START G EXIT
11 S ZTRTN="START^ESPORP",ZTSAVE("ESP*")="",ZTDESC="OFFENSE REPORT" D ^%ZTLOAD,HOME^%ZIS G EXIT
12START ; BEGINS THE PRINT OF THIS OFFENSE REPORT
13 N ESPFACI
14 K ^UTILITY("DIQ1",$J) S (END,PAGE)=0 D HDR G:END EXIT
15 S DIC="^ESP(912,",DA=ESPID,DR=".02;.03;.04;.05;.06;.09;.11;.12",DIQ(0)="E" D EN^DIQ1 I '$D(^UTILITY("DIQ1",$J,912,DA)) W !,"RECORD DOESN'T EXIST!" G EXIT
16DTR W !,"DATE/TIME RECEIVED: ",$G(^UTILITY("DIQ1",$J,912,DA,.02,"E"))
17DTO W !,"DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.03,"E"))
18EDTO W !,"ENDING DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.09,"E"))
19LOC W !,"LOCATION: ",$G(^UTILITY("DIQ1",$J,912,DA,.04,"E"))
20WEAP W !,"WEAPON USED: ",$G(^UTILITY("DIQ1",$J,912,DA,.05,"E"))
21PO W !,"INVESTIGATING OFFICER: ",$G(^UTILITY("DIQ1",$J,912,DA,.06,"E"))
22 S BADGE=^UTILITY("DIQ1",$J,912,DA,.11,"E")
23MO K ^UTILITY($J,"W") S DIWL=3,DIWR=78,DIWF="W",IEN=0
24 W !,"METHOD OF OPERATION: ",!
25 F ESPN=1:1 S IEN=$O(^ESP(912,ESPID,60,IEN)) Q:IEN'>0 S X=^(IEN,0) D G EXIT:END
26 . D HDR:$Y+2>IOSL Q:END
27 . D ^DIWP
28 D MIN(2) Q:END
29 D ^DIWW
30CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
31 F ESPN=0:0 S ESPN=$O(^ESP(912,ESPID,10,ESPN)) Q:ESPN'>0 D G EXIT:END
32 . 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"))
33 . D LINES()
34 . W "CLASSIFICATION CODE: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
35 . I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
36 . I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
37 G ^ESPORP1
38EXIT K %ZIS,CL,DA,DIC,DIQ,DIR,DIRUT,DIWF,DIWL,DIWR,DR,END,ESPDTR,ESPID,ESPN,ESPN1,IEN,PAGE,X,Y,ZTDESC,ZTRTN,ZTSAVE,BADGE
39 K ^UTILITY("DIQ1",$J)
40 QUIT
41HDR ;PRINT HEADING
42 I PAGE>0,$E(IOST,1,2)="C-" S END=$$EOP^ESPUTIL() Q:END
43 S PAGE=PAGE+1 W:PAGE'=1 @IOF W !?25,"DEPARTMENT OF VETERANS AFFAIRS",?(IOM-10),"Page ",$J(PAGE,3)
44 W !?35,"VA POLICE",!?28,"UNIFORM OFFENSE REPORT"
45 W !?30,"UOR# ",$E(ESPDTR,2,3),"-",$E(ESPDTR,4,5),"-",$E(ESPDTR,6,7),"-",$TR($E($P(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
46 W !!,"VA Facility" W ?61,"Date/Time Printed"
47 S ESPFACI=$P(^ESP(912,ESPID,0),U,7) S ESPFACI=$S(ESPFACI="":"",$D(^DG(40.8,ESPFACI,0)):$P(^(0),U),1:"")
48 I ESPFACI="",$D(^ESP(912,ESPID,5)),$P(^(5),U)'="" S ESPFACI=$S($D(^DIC(4,$P(^(5),U),0)):$P(^(0),U),1:"")
49 W !,ESPFACI
50 W ?61,$$NOW^ESPUTIL()
51 W !,"Automated VA Form 10-1393"
52 W !!
53 QUIT
54 ;
55 ;ENTRY POINT OR1 IS TO ALLOWS PRINT OF AN INCOMPLETE REPORT
56 ;THIS OPTION IS ONLY FOR PERSONS HOLDING THE CHIEF KEY
57OR1 S DIC(0)="AEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,5)",DIC="^ESP(912,"
58 D ^DIC G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT G:Y<0 OR1 S ESPDTR=$P(^ESP(912,+Y,0),U,2),ESPID=+Y
59 D Q
60 QUIT
61 ;
62LINES(COUNT) ;
63 ;writes COUNT lines
64 ;writes header if necessary
65 ;
66 N CRT,INDEX
67 I '$D(COUNT) S COUNT=1
68 S CRT=$S(($E(IOST,1,2)="C-"):1,1:0)
69 F INDEX=1:1:COUNT D Q:END
70 .I $Y>(IOSL-(1+CRT)) D HDR Q:END
71 .W !
72 Q
73 ;
74MIN(COUNT) ;
75 ;prints header if not minimum of COUNT pages left
76 ;first gives end of page message if crt
77 ;
78 N CRT
79 S CRT=$S(($E(IOST,1,2)="C-"):1,1:0)
80 S COUNT=COUNT+CRT
81 I ($Y>(IOSL-(COUNT))) D HDR
82 Q
Note: See TracBrowser for help on using the repository browser.