VistA-WorldVistAEHR/r/POLICE_AND_SECURITY-ES/ESPOFF3.m

31 lines
1.3 KiB
Mathematica

ESPOFF3 ;DALISC/CKA - OFFENSE REPORT INPUT (CONT.);9/92
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN Q ;Called from ESPOFF2
;Check if this report falls within VACO 48 hour reporting criteria
CHECK ; ENTRY POINT FROM ESPOFF2
S ESPCN=0
F ESPX=1:1 S ESPCN=$O(^ESP(912,ESPOFN,10,ESPCN)) Q:ESPCN'>0 D
. S ESPCL=^ESP(912,ESPOFN,10,ESPCN,0),ESPCC=$P(ESPCL,U),ESPTYPE=$P(ESPCL,U,2),ESPSUB=$P(ESPCL,U,3)
. ;BURGLARIES OF CANTEEN, CASHIER, OR PHARMACY
. I ESPCC=2,ESPTYPE=7!(ESPTYPE=8)!(ESPTYPE=11) S ESPBULL=1 QUIT
. ;RAPES
. I ESPCC=8 S ESPBULL=1 QUIT
. ;ROBBERIES
. I ESPCC=9 S ESPBULL=1 QUIT
. ;DRUG THEFTS
. I ESPCC=11,ESPTYPE=45 S ESPBULL=1 QUIT
. ;FORGED RX'S
. I ESPCC=3,ESPTYPE=14,ESPSUB=4 S ESPBULL=1 QUIT
. ;POLICE OFFICER ASSAULT
. I ESPCC=1 F ESPN=1:1 S VIC=$O(^ESP(912,ESPOFN,30,ESPN)) Q:VIC'>0 I $P(^ESP(912,ESPOFN,30,ESPN,0),U,5)["PO" S ESPBULL=1 QUIT
. ;GOVT. PROPERTY THEFT > $5,000
. S LOSS=0
. I ESPCC=11,ESPTYPE=46 F ESPN=1:1 S PROP=$O(^ESP(912,ESPOFN,90,ESPN)) Q:PROP'>0 S LOSS=LOSS+$P($G(^ESP(912,ESPOFN,90,ESPN,0)),U,3)
. I LOSS>5000 S ESPBULL=1
;SEND BULLETIN IF MEETS VACO REPORTING CRITERIA
G:'$D(ESPBULL) EXIT
S ESPDTR=$P(^ESP(912,ESPOFN,0),U,2),XMB(1)=$$CONV^ESPUOR(ESPDTR),XMB="ESP VACO 48 HR CRITERIA"
D EN^XMB
EXIT K ESPBULL,ESPCC,ESPCL,ESPCN,ESPN,ESPSUB,ESPTYPE,ESPX,LOSS,PROP,VIC
QUIT