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

99 lines
4.1 KiB
Mathematica

ESPDISP ;DALISC/CKA - DISPLAYS DATA OFFENSE REPORT EDIT;8/92
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
COM ;DISPLAY COMPLAINANTS
Q:'$D(DA) W !!,"COMPLAINANT DATA",! S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,20,NUM)) Q:NUM'>0 D
. S ESPFN=$P(^ESP(912,ESPID,20,NUM,0),U,2),ESPNAM="" S:ESPFN]"" ESPNAM=$P($G(^ESP(910,ESPFN,0)),U)
. W !?5,NUM," ",ESPNAM
I '$D(ESPDO) S NUM=$P($G(^ESP(912,ESPID,20,0)),U,3) D NUM
K ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
QUIT
STUFF1 ;STUFF COMPLAINANT INFO
S ESPFN=$P(^ESP(912,DA(1),20,DA,0),U,2),COMP0=^ESP(910,ESPFN,0),$P(^ESP(912,DA(1),20,DA,0),U,3)=$P(COMP0,U,4)
S ^ESP(912,DA(1),20,DA,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,DA(1),20,DA,2)=$G(^ESP(910,ESPFN,2))
K COMP0,ESPFN
Q
;
VIC ;DISPLAY VICTIMS
Q:'$D(DA) W !!,"VICTIM DATA",! S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,30,NUM)) Q:NUM'>0 D
. S ESPFN=$P(^ESP(912,ESPID,30,NUM,0),U,2),ESPNAM="" S:ESPFN]"" ESPNAM=$P($G(^ESP(910,+ESPFN,0)),U)
. W !?5,NUM," ",ESPNAM
I '$D(ESPDO) S NUM=$P($G(^ESP(912,ESPID,30,0)),U,3) D NUM
K ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
QUIT
STUFF2 ;STUFF VICTIM INFO
S ESPFN=$P(^ESP(912,DA(1),30,DA,0),U,2),VIC0=^ESP(910,ESPFN,0)
S $P(^ESP(912,DA(1),30,DA,0),U,3,7)=$P(VIC0,U,8,9)_"^"_$P(VIC0,U,4)_"^"_$P(VIC0,U,10,11)
S ^ESP(912,DA(1),30,DA,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,DA(1),30,DA,2)=$G(^ESP(910,ESPFN,2))
K VIC0,ESPFN
Q
OFF ;DISPLAY OFFENDERS
Q:'$D(DA) W !!,"OFFENDER DATA",! S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,40,NUM)) Q:NUM'>0 D
. S ESPFN=$P(^ESP(912,ESPID,40,NUM,0),U,2) S:ESPFN'="" ESPNAM(NUM)=$P($G(^ESP(910,ESPFN,0)),U) S:ESPFN="" ESPNAM(NUM)="UNKNOWN"
. W !?5,NUM," ",ESPNAM(NUM)
I '$D(ESPDO) S NUM=$P($G(^ESP(912,ESPID,40,0)),U,3) D NUM
K ESPDO,ESPFN,ESPN,NUM,Y
QUIT
STUFF3 ;STUFF OFFENDER INFO
S ESPFN=$P(^ESP(912,DA(1),40,DA,0),U,2),OFF0=^ESP(910,ESPFN,0)
S $P(^ESP(912,DA(1),40,DA,0),U,3,4)=$P(OFF0,U,8,9),ESPDESCR=$G(^ESP(910,ESPFN,3)),$P(^ESP(912,DA(1),40,DA,0),U,5,10)=ESPDESCR
S $P(^ESP(912,DA(1),40,DA,0),U,11)=$P(OFF0,U,4),$P(^ESP(912,DA(1),40,DA,0),U,12,13)=$P(OFF0,U,10,11)
S ^ESP(912,DA(1),40,DA,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,DA(1),40,DA,2)=$G(^ESP(910,ESPFN,2))
K ESPDESCR,OFF0,ESPFN
Q
WIT ;DISPLAY WITNESSES
Q:'$D(DA) W !!,"WITNESS DATA",! S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,50,NUM)) Q:NUM'>0 D
. S ESPFN=$P(^ESP(912,ESPID,50,NUM,0),U,2),ESPNAM="" S:ESPFN]"" ESPNAM=$P($G(^ESP(910,+ESPFN,0)),U)
. W !?5,NUM," ",ESPNAM
I '$D(ESPDO) S NUM=$P($G(^ESP(912,ESPID,50,0)),U,3) D NUM
K ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
QUIT
STUFF4 ;STUFF WITNESS INFO
S ESPFN=$P(^ESP(912,DA(1),50,DA,0),U,2),WIT0=^ESP(910,ESPFN,0),$P(^ESP(912,DA(1),50,DA,0),U,3)=$P(WIT0,U,4)
S ^ESP(912,DA(1),50,DA,1)=$G(^ESP(910,ESPFN,1)),^ESP(912,DA(1),50,DA,2)=$G(^ESP(910,ESPFN,2))
K WIT0,ESPFN
Q
VEH ;DISPLAY VEHICLES
S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,80,NUM)) Q:NUM'>0 D
. W !?5,NUM," ",$P($G(^ESP(912,ESPID,80,NUM,0)),U,2)," ",$P($G(^DIC(5,+$P($G(^(0)),U,3),0)),U,2)
K ESPN,NUM
QUIT
LOST ;DISPLAY LOST PROPERTY
S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,90,NUM)) Q:NUM'>0 D
. W !?5,NUM," ",$P($G(^ESP(912,ESPID,90,NUM,0)),U)," "
K ESPN,NUM
QUIT
HELD ;DISPLAY PROPERTY (HELD)
S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,100,NUM)) Q:NUM'>0 D
. W !?5,NUM," ",$P($G(^ESP(912,ESPID,100,NUM,0)),U,2)," ",$P($G(^(0)),U,3)
K ESPN,NUM
QUIT
OTH ;DISPLAY OTHER AGENCIES NOTIFICATIONS
S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,110,NUM)) Q:NUM'>0 D
. W !?5,NUM," " S Y=$P($G(^ESP(912,ESPID,110,NUM,0)),U) X ^DD("DD") W Y
K ESPN,NUM,Y
QUIT
ATTY ;DISPLAY U.S ATTORNEY NOTIFICATIONS
S NUM=0,ESPID=DA
F ESPN=0:0 S NUM=$O(^ESP(912,ESPID,120,NUM)) Q:NUM'>0 D
. W !?5,NUM," " S Y=$P($G(^ESP(912,ESPID,120,NUM,0)),U) X ^DD("DD") W Y
K ESPN,NUM,Y
QUIT
NUM S NEWNUM=NUM+1,DIR("A")="Enter "_NEWNUM_" to add a new entry",DIR(0)="N^"_NEWNUM_":"_NEWNUM_":0^",DIR("??")="^W !?5,""Enter "_NEWNUM_" to add a new entry."""
D ^DIR K:$D(DIRUT) X K DIR,ESPNAM(NEWNUM),NEWNUM
QUIT
UNKN ;Ask if unknown if offender
S DIR(0)="Y",DIR("A")="Is this an unknown offender",DIR("B")="NO"
D ^DIR K DIR
I 'Y S ESPNAM(DA)="",Y=.02 QUIT
I Y S ESPNAM(DA)="UNKNOWN",Y=.03
QUIT