source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPUCF1.m@ 1361

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

initial load of WorldVistAEHR

File size: 4.3 KB
RevLine 
[613]1ESPUCF1 ;DALISC/CKA - UNIFORM CRIME REPORT COUNT AND GET TOTALS- 3/99
2 ;;1.0;POLICE & SECURITY;**27**;Mar 31, 1994
3EN Q ;CALLED FROM ESPUCF
4SET ;CALLED FROM ESPUCF TO ADD CRIME REPORT TOTALS IN CRIME DATA FILE
5 S ESPCL=^ESP(912,ESPOFN,10,ESPCN,0),ESPCC=$P(ESPCL,U),ESPTYPE=$P(ESPCL,U,2),ESPSUB=$P(ESPCL,U,3)
6 I ESPCC=1 D ASLT QUIT
7 I ESPCC=2 D BURG QUIT
8 I ESPCC=3 D CONT QUIT
9 I ESPCC=4 D DIST^ESPUCF2 QUIT
10 I ESPCC=5 D MUR^ESPUCF2 QUIT
11 I ESPCC=6 D NON^ESPUCF2 QUIT
12 I ESPCC=7 D OTH^ESPUCF2 QUIT
13 I ESPCC=8 D RAPE^ESPUCF3 QUIT
14 I ESPCC=9 D ROBB^ESPUCF3 QUIT
15 I ESPCC=10 D STOP^ESPUCF4 QUIT
16 I ESPCC=11 D THEFT^ESPUCF4 QUIT
17 I ESPCC=12 D VAND^ESPUCF5 QUIT
18 I ESPCC=13 D VICE^ESPUCF5 QUIT
19 I ESPCC=14 D VIO^ESPUCF5 QUIT
20EXIT QUIT
21ASLT ;ASSAULT TOTALS
22OF ; COUNT VICTIMS AND OFFENDERS
23 S ESPVIC=0
24 F ESPX=1:1 S ESPVIC=$O(^ESP(912,ESPOFN,30,ESPVIC)) Q:ESPVIC'>0 D
25 . S ESPVICT=$P(^ESP(912,ESPOFN,30,ESPVIC,0),U,5),^(1)=^ESP(912.3,ESPIEN,1,ESPINS,1)+1 D
26 .. I ESPTYPE=1 S ^(2)=^ESP(912.3,ESPIEN,1,ESPINS,2)+1 QUIT
27 .. I ESPTYPE=2 S ^(3)=^ESP(912.3,ESPIEN,1,ESPINS,3)+1 QUIT
28 .. I ESPTYPE=3 S ^(4)=^ESP(912.3,ESPIEN,1,ESPINS,4)+1 QUIT
29 .. I ESPTYPE=4 S ^(5)=^ESP(912.3,ESPIEN,1,ESPINS,5)+1 QUIT
30 .. I ESPTYPE=5 S ^(6)=^ESP(912.3,ESPIEN,1,ESPINS,6)+1 QUIT
31 . I ESPVICT="E" S ^(12)=^ESP(912.3,ESPIEN,1,ESPINS,12)+1 QUIT
32 . I ESPVICT="PO" S ^(13)=^ESP(912.3,ESPIEN,1,ESPINS,13)+1 QUIT
33 . I ESPVICT="O" S ^(14)=^ESP(912.3,ESPIEN,1,ESPINS,14)+1 QUIT
34 . I ESPVICT="P" S ^(15)=^ESP(912.3,ESPIEN,1,ESPINS,15)+1 QUIT
35 . I ESPVICT="V" S ^(17)=^ESP(912.3,ESPIEN,1,ESPINS,17)+1 QUIT
36 . S ^(16)=^ESP(912.3,ESPIEN,1,ESPINS,16)+1
37 I $D(^ESP(912,ESPOFN,30)) D OFFE
38 QUIT
39OFFE ;COUNT OFFENDERS
40 S ESPOF=0
41 F ESPX=1:1 S ESPOF=$O(^ESP(912,ESPOFN,40,ESPOF)) Q:ESPOF'>0 D
42 . S ESPOFF=$P(^ESP(912,ESPOFN,40,ESPOF,0),U,11)
43 . I ESPOFF="E"!(ESPOFF="PO") S ^(7)=^ESP(912.3,ESPIEN,1,ESPINS,7)+1 QUIT
44 . I ESPOFF="O" S ^(8)=^ESP(912.3,ESPIEN,1,ESPINS,8)+1 QUIT
45 . I ESPOFF="P" S ^(9)=^ESP(912.3,ESPIEN,1,ESPINS,9)+1 QUIT
46 . I ESPOFF="V" S ^(11)=^ESP(912.3,ESPIEN,1,ESPINS,11)+1 QUIT
47 . S ^(10)=^ESP(912.3,ESPIEN,1,ESPINS,10)+1
48 QUIT
49BURG ;BURGLARY TOTALS
50 S ^(18)=^ESP(912.3,ESPIEN,1,ESPINS,18)+1
51 I ESPTYPE=6 S ^(19)=^ESP(912.3,ESPIEN,1,ESPINS,19)+1 D DOL QUIT
52 I ESPTYPE=7 S ^(20)=^ESP(912.3,ESPIEN,1,ESPINS,20)+1 D DOL QUIT
53 I ESPTYPE=8 S ^(21)=^ESP(912.3,ESPIEN,1,ESPINS,21)+1 D DOL QUIT
54 I ESPTYPE=9 S ^(22)=^ESP(912.3,ESPIEN,1,ESPINS,22)+1 D DOL QUIT
55 I ESPTYPE=10 S ^(23)=^ESP(912.3,ESPIEN,1,ESPINS,23)+1 D DOL QUIT
56 I ESPTYPE=11 S ^(24)=^ESP(912.3,ESPIEN,1,ESPINS,24)+1 D DOL QUIT
57 I ESPTYPE=12 S ^(25)=^ESP(912.3,ESPIEN,1,ESPINS,25)+1 D DOL QUIT
58 QUIT
59DOL ;ADD DOLLAR TOTALS
60 S ESPDOL=0
61 F ESPX=1:1 S ESPDOL=$O(^ESP(912,ESPOFN,90,ESPDOL)) Q:ESPDOL'>0 D
62 . S ^ESP(912.3,ESPIEN,1,ESPINS,26)=^ESP(912.3,ESPIEN,1,ESPINS,26)+$P($G(^ESP(912,ESPOFN,90,ESPDOL,0)),U,3)
63 . S ^ESP(912.3,ESPIEN,1,ESPINS,27)=^ESP(912.3,ESPIEN,1,ESPINS,27)+$P($G(^ESP(912,ESPOFN,90,ESPDOL,0)),U,4)
64 QUIT
65CONT ;CONTRABAND TOTALS
66OFC ;CONTRABAND OFFENDER TOTALS
67 S ESPOF=0
68 F ESPX=1:1 S ESPOF=$O(^ESP(912,ESPOFN,40,ESPOF)) Q:ESPOF'>0 D
69 . S ESPOFF=$P(^ESP(912,ESPOFN,40,ESPOF,0),U,11),^(28)=^ESP(912.3,ESPIEN,1,ESPINS,28)+1 D
70 .. ;ALCOHOL CONTRABAND
71 .. I ESPTYPE=13 D
72 ... I ESPSUB=1 S ^(34)=^ESP(912.3,ESPIEN,1,ESPINS,34)+1 QUIT
73 ... I ESPSUB=2 S ^(35)=^ESP(912.3,ESPIEN,1,ESPINS,35)+1 QUIT
74 ... I ESPSUB=3 S ^(36)=^ESP(912.3,ESPIEN,1,ESPINS,36)+1
75 .. ;DRUG CONTRABAND
76 .. I ESPTYPE=14 D
77 ... I ESPSUB=4 S ^(29)=^ESP(912.3,ESPIEN,1,ESPINS,29)+1 QUIT
78 ... I ESPSUB=5 S ^(30)=^ESP(912.3,ESPIEN,1,ESPINS,30)+1 QUIT
79 ... I ESPSUB=6 S ^(31)=^ESP(912.3,ESPIEN,1,ESPINS,31)+1 QUIT
80 ... I ESPSUB=7 S ^(32)=^ESP(912.3,ESPIEN,1,ESPINS,32)+1 QUIT
81 ... I ESPSUB=8 S ^(33)=^ESP(912.3,ESPIEN,1,ESPINS,33)+1 QUIT
82 .. ;WEAPON CONTRABAND
83 .. I ESPTYPE=15 D
84 ... I ESPSUB=35 S ^(37)=^ESP(912.3,ESPIEN,1,ESPINS,37)+1 QUIT
85 ... I ESPSUB=36 S ^(38)=^ESP(912.3,ESPIEN,1,ESPINS,38)+1 QUIT
86 ... I ESPSUB=37 S ^(39)=^ESP(912.3,ESPIEN,1,ESPINS,39)+1 QUIT
87 ... I ESPSUB=38 S ^(40)=^ESP(912.3,ESPIEN,1,ESPINS,40)+1 QUIT
88 . I ESPOFF="E"!(ESPOFF="PO") S ^(41)=^ESP(912.3,ESPIEN,1,ESPINS,41)+1 QUIT
89 . I ESPOFF="O" S ^(42)=^ESP(912.3,ESPIEN,1,ESPINS,42)+1 QUIT
90 . I ESPOFF="P" S ^(43)=^ESP(912.3,ESPIEN,1,ESPINS,43)+1 QUIT
91 . I ESPOFF="V" S ^(45)=^ESP(912.3,ESPIEN,1,ESPINS,45)+1 QUIT
92 . S ^(44)=^ESP(912.3,ESPIEN,1,ESPINS,44)+1
93 QUIT
Note: See TracBrowser for help on using the repository browser.