94 lines
4.3 KiB
Mathematica
94 lines
4.3 KiB
Mathematica
ESPUCF1 ;DALISC/CKA - UNIFORM CRIME REPORT COUNT AND GET TOTALS- 3/99
|
|
;;1.0;POLICE & SECURITY;**27**;Mar 31, 1994
|
|
EN Q ;CALLED FROM ESPUCF
|
|
SET ;CALLED FROM ESPUCF TO ADD CRIME REPORT TOTALS IN CRIME DATA FILE
|
|
S ESPCL=^ESP(912,ESPOFN,10,ESPCN,0),ESPCC=$P(ESPCL,U),ESPTYPE=$P(ESPCL,U,2),ESPSUB=$P(ESPCL,U,3)
|
|
I ESPCC=1 D ASLT QUIT
|
|
I ESPCC=2 D BURG QUIT
|
|
I ESPCC=3 D CONT QUIT
|
|
I ESPCC=4 D DIST^ESPUCF2 QUIT
|
|
I ESPCC=5 D MUR^ESPUCF2 QUIT
|
|
I ESPCC=6 D NON^ESPUCF2 QUIT
|
|
I ESPCC=7 D OTH^ESPUCF2 QUIT
|
|
I ESPCC=8 D RAPE^ESPUCF3 QUIT
|
|
I ESPCC=9 D ROBB^ESPUCF3 QUIT
|
|
I ESPCC=10 D STOP^ESPUCF4 QUIT
|
|
I ESPCC=11 D THEFT^ESPUCF4 QUIT
|
|
I ESPCC=12 D VAND^ESPUCF5 QUIT
|
|
I ESPCC=13 D VICE^ESPUCF5 QUIT
|
|
I ESPCC=14 D VIO^ESPUCF5 QUIT
|
|
EXIT QUIT
|
|
ASLT ;ASSAULT TOTALS
|
|
OF ; COUNT VICTIMS AND OFFENDERS
|
|
S ESPVIC=0
|
|
F ESPX=1:1 S ESPVIC=$O(^ESP(912,ESPOFN,30,ESPVIC)) Q:ESPVIC'>0 D
|
|
. S ESPVICT=$P(^ESP(912,ESPOFN,30,ESPVIC,0),U,5),^(1)=^ESP(912.3,ESPIEN,1,ESPINS,1)+1 D
|
|
.. I ESPTYPE=1 S ^(2)=^ESP(912.3,ESPIEN,1,ESPINS,2)+1 QUIT
|
|
.. I ESPTYPE=2 S ^(3)=^ESP(912.3,ESPIEN,1,ESPINS,3)+1 QUIT
|
|
.. I ESPTYPE=3 S ^(4)=^ESP(912.3,ESPIEN,1,ESPINS,4)+1 QUIT
|
|
.. I ESPTYPE=4 S ^(5)=^ESP(912.3,ESPIEN,1,ESPINS,5)+1 QUIT
|
|
.. I ESPTYPE=5 S ^(6)=^ESP(912.3,ESPIEN,1,ESPINS,6)+1 QUIT
|
|
. I ESPVICT="E" S ^(12)=^ESP(912.3,ESPIEN,1,ESPINS,12)+1 QUIT
|
|
. I ESPVICT="PO" S ^(13)=^ESP(912.3,ESPIEN,1,ESPINS,13)+1 QUIT
|
|
. I ESPVICT="O" S ^(14)=^ESP(912.3,ESPIEN,1,ESPINS,14)+1 QUIT
|
|
. I ESPVICT="P" S ^(15)=^ESP(912.3,ESPIEN,1,ESPINS,15)+1 QUIT
|
|
. I ESPVICT="V" S ^(17)=^ESP(912.3,ESPIEN,1,ESPINS,17)+1 QUIT
|
|
. S ^(16)=^ESP(912.3,ESPIEN,1,ESPINS,16)+1
|
|
I $D(^ESP(912,ESPOFN,30)) D OFFE
|
|
QUIT
|
|
OFFE ;COUNT OFFENDERS
|
|
S ESPOF=0
|
|
F ESPX=1:1 S ESPOF=$O(^ESP(912,ESPOFN,40,ESPOF)) Q:ESPOF'>0 D
|
|
. S ESPOFF=$P(^ESP(912,ESPOFN,40,ESPOF,0),U,11)
|
|
. I ESPOFF="E"!(ESPOFF="PO") S ^(7)=^ESP(912.3,ESPIEN,1,ESPINS,7)+1 QUIT
|
|
. I ESPOFF="O" S ^(8)=^ESP(912.3,ESPIEN,1,ESPINS,8)+1 QUIT
|
|
. I ESPOFF="P" S ^(9)=^ESP(912.3,ESPIEN,1,ESPINS,9)+1 QUIT
|
|
. I ESPOFF="V" S ^(11)=^ESP(912.3,ESPIEN,1,ESPINS,11)+1 QUIT
|
|
. S ^(10)=^ESP(912.3,ESPIEN,1,ESPINS,10)+1
|
|
QUIT
|
|
BURG ;BURGLARY TOTALS
|
|
S ^(18)=^ESP(912.3,ESPIEN,1,ESPINS,18)+1
|
|
I ESPTYPE=6 S ^(19)=^ESP(912.3,ESPIEN,1,ESPINS,19)+1 D DOL QUIT
|
|
I ESPTYPE=7 S ^(20)=^ESP(912.3,ESPIEN,1,ESPINS,20)+1 D DOL QUIT
|
|
I ESPTYPE=8 S ^(21)=^ESP(912.3,ESPIEN,1,ESPINS,21)+1 D DOL QUIT
|
|
I ESPTYPE=9 S ^(22)=^ESP(912.3,ESPIEN,1,ESPINS,22)+1 D DOL QUIT
|
|
I ESPTYPE=10 S ^(23)=^ESP(912.3,ESPIEN,1,ESPINS,23)+1 D DOL QUIT
|
|
I ESPTYPE=11 S ^(24)=^ESP(912.3,ESPIEN,1,ESPINS,24)+1 D DOL QUIT
|
|
I ESPTYPE=12 S ^(25)=^ESP(912.3,ESPIEN,1,ESPINS,25)+1 D DOL QUIT
|
|
QUIT
|
|
DOL ;ADD DOLLAR TOTALS
|
|
S ESPDOL=0
|
|
F ESPX=1:1 S ESPDOL=$O(^ESP(912,ESPOFN,90,ESPDOL)) Q:ESPDOL'>0 D
|
|
. 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)
|
|
. 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)
|
|
QUIT
|
|
CONT ;CONTRABAND TOTALS
|
|
OFC ;CONTRABAND OFFENDER TOTALS
|
|
S ESPOF=0
|
|
F ESPX=1:1 S ESPOF=$O(^ESP(912,ESPOFN,40,ESPOF)) Q:ESPOF'>0 D
|
|
. S ESPOFF=$P(^ESP(912,ESPOFN,40,ESPOF,0),U,11),^(28)=^ESP(912.3,ESPIEN,1,ESPINS,28)+1 D
|
|
.. ;ALCOHOL CONTRABAND
|
|
.. I ESPTYPE=13 D
|
|
... I ESPSUB=1 S ^(34)=^ESP(912.3,ESPIEN,1,ESPINS,34)+1 QUIT
|
|
... I ESPSUB=2 S ^(35)=^ESP(912.3,ESPIEN,1,ESPINS,35)+1 QUIT
|
|
... I ESPSUB=3 S ^(36)=^ESP(912.3,ESPIEN,1,ESPINS,36)+1
|
|
.. ;DRUG CONTRABAND
|
|
.. I ESPTYPE=14 D
|
|
... I ESPSUB=4 S ^(29)=^ESP(912.3,ESPIEN,1,ESPINS,29)+1 QUIT
|
|
... I ESPSUB=5 S ^(30)=^ESP(912.3,ESPIEN,1,ESPINS,30)+1 QUIT
|
|
... I ESPSUB=6 S ^(31)=^ESP(912.3,ESPIEN,1,ESPINS,31)+1 QUIT
|
|
... I ESPSUB=7 S ^(32)=^ESP(912.3,ESPIEN,1,ESPINS,32)+1 QUIT
|
|
... I ESPSUB=8 S ^(33)=^ESP(912.3,ESPIEN,1,ESPINS,33)+1 QUIT
|
|
.. ;WEAPON CONTRABAND
|
|
.. I ESPTYPE=15 D
|
|
... I ESPSUB=35 S ^(37)=^ESP(912.3,ESPIEN,1,ESPINS,37)+1 QUIT
|
|
... I ESPSUB=36 S ^(38)=^ESP(912.3,ESPIEN,1,ESPINS,38)+1 QUIT
|
|
... I ESPSUB=37 S ^(39)=^ESP(912.3,ESPIEN,1,ESPINS,39)+1 QUIT
|
|
... I ESPSUB=38 S ^(40)=^ESP(912.3,ESPIEN,1,ESPINS,40)+1 QUIT
|
|
. I ESPOFF="E"!(ESPOFF="PO") S ^(41)=^ESP(912.3,ESPIEN,1,ESPINS,41)+1 QUIT
|
|
. I ESPOFF="O" S ^(42)=^ESP(912.3,ESPIEN,1,ESPINS,42)+1 QUIT
|
|
. I ESPOFF="P" S ^(43)=^ESP(912.3,ESPIEN,1,ESPINS,43)+1 QUIT
|
|
. I ESPOFF="V" S ^(45)=^ESP(912.3,ESPIEN,1,ESPINS,45)+1 QUIT
|
|
. S ^(44)=^ESP(912.3,ESPIEN,1,ESPINS,44)+1
|
|
QUIT
|