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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPDISP 4327 printed Dec 13, 2024@02:29:37 Page 2
ESPDISP ;DALISC/CKA - DISPLAYS DATA OFFENSE REPORT EDIT;8/92
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
COM ;DISPLAY COMPLAINANTS
+1 if '$DATA(DA)
QUIT
WRITE !!,"COMPLAINANT DATA",!
SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,20,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 SET ESPFN=$PIECE(^ESP(912,ESPID,20,NUM,0),U,2)
SET ESPNAM=""
if ESPFN]""
SET ESPNAM=$PIECE($GET(^ESP(910,ESPFN,0)),U)
+4 WRITE !?5,NUM," ",ESPNAM
End DoDot:1
+5 IF '$DATA(ESPDO)
SET NUM=$PIECE($GET(^ESP(912,ESPID,20,0)),U,3)
DO NUM
+6 KILL ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
+7 QUIT
STUFF1 ;STUFF COMPLAINANT INFO
+1 SET ESPFN=$PIECE(^ESP(912,DA(1),20,DA,0),U,2)
SET COMP0=^ESP(910,ESPFN,0)
SET $PIECE(^ESP(912,DA(1),20,DA,0),U,3)=$PIECE(COMP0,U,4)
+2 SET ^ESP(912,DA(1),20,DA,1)=$GET(^ESP(910,ESPFN,1))
SET ^ESP(912,DA(1),20,DA,2)=$GET(^ESP(910,ESPFN,2))
+3 KILL COMP0,ESPFN
+4 QUIT
+5 ;
VIC ;DISPLAY VICTIMS
+1 if '$DATA(DA)
QUIT
WRITE !!,"VICTIM DATA",!
SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,30,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 SET ESPFN=$PIECE(^ESP(912,ESPID,30,NUM,0),U,2)
SET ESPNAM=""
if ESPFN]""
SET ESPNAM=$PIECE($GET(^ESP(910,+ESPFN,0)),U)
+4 WRITE !?5,NUM," ",ESPNAM
End DoDot:1
+5 IF '$DATA(ESPDO)
SET NUM=$PIECE($GET(^ESP(912,ESPID,30,0)),U,3)
DO NUM
+6 KILL ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
+7 QUIT
STUFF2 ;STUFF VICTIM INFO
+1 SET ESPFN=$PIECE(^ESP(912,DA(1),30,DA,0),U,2)
SET VIC0=^ESP(910,ESPFN,0)
+2 SET $PIECE(^ESP(912,DA(1),30,DA,0),U,3,7)=$PIECE(VIC0,U,8,9)_"^"_$PIECE(VIC0,U,4)_"^"_$PIECE(VIC0,U,10,11)
+3 SET ^ESP(912,DA(1),30,DA,1)=$GET(^ESP(910,ESPFN,1))
SET ^ESP(912,DA(1),30,DA,2)=$GET(^ESP(910,ESPFN,2))
+4 KILL VIC0,ESPFN
+5 QUIT
OFF ;DISPLAY OFFENDERS
+1 if '$DATA(DA)
QUIT
WRITE !!,"OFFENDER DATA",!
SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,40,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 SET ESPFN=$PIECE(^ESP(912,ESPID,40,NUM,0),U,2)
if ESPFN'=""
SET ESPNAM(NUM)=$PIECE($GET(^ESP(910,ESPFN,0)),U)
if ESPFN=""
SET ESPNAM(NUM)="UNKNOWN"
+4 WRITE !?5,NUM," ",ESPNAM(NUM)
End DoDot:1
+5 IF '$DATA(ESPDO)
SET NUM=$PIECE($GET(^ESP(912,ESPID,40,0)),U,3)
DO NUM
+6 KILL ESPDO,ESPFN,ESPN,NUM,Y
+7 QUIT
STUFF3 ;STUFF OFFENDER INFO
+1 SET ESPFN=$PIECE(^ESP(912,DA(1),40,DA,0),U,2)
SET OFF0=^ESP(910,ESPFN,0)
+2 SET $PIECE(^ESP(912,DA(1),40,DA,0),U,3,4)=$PIECE(OFF0,U,8,9)
SET ESPDESCR=$GET(^ESP(910,ESPFN,3))
SET $PIECE(^ESP(912,DA(1),40,DA,0),U,5,10)=ESPDESCR
+3 SET $PIECE(^ESP(912,DA(1),40,DA,0),U,11)=$PIECE(OFF0,U,4)
SET $PIECE(^ESP(912,DA(1),40,DA,0),U,12,13)=$PIECE(OFF0,U,10,11)
+4 SET ^ESP(912,DA(1),40,DA,1)=$GET(^ESP(910,ESPFN,1))
SET ^ESP(912,DA(1),40,DA,2)=$GET(^ESP(910,ESPFN,2))
+5 KILL ESPDESCR,OFF0,ESPFN
+6 QUIT
WIT ;DISPLAY WITNESSES
+1 if '$DATA(DA)
QUIT
WRITE !!,"WITNESS DATA",!
SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,50,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 SET ESPFN=$PIECE(^ESP(912,ESPID,50,NUM,0),U,2)
SET ESPNAM=""
if ESPFN]""
SET ESPNAM=$PIECE($GET(^ESP(910,+ESPFN,0)),U)
+4 WRITE !?5,NUM," ",ESPNAM
End DoDot:1
+5 IF '$DATA(ESPDO)
SET NUM=$PIECE($GET(^ESP(912,ESPID,50,0)),U,3)
DO NUM
+6 KILL ESPDO,ESPFN,ESPN,ESPNAM,NUM,Y
+7 QUIT
STUFF4 ;STUFF WITNESS INFO
+1 SET ESPFN=$PIECE(^ESP(912,DA(1),50,DA,0),U,2)
SET WIT0=^ESP(910,ESPFN,0)
SET $PIECE(^ESP(912,DA(1),50,DA,0),U,3)=$PIECE(WIT0,U,4)
+2 SET ^ESP(912,DA(1),50,DA,1)=$GET(^ESP(910,ESPFN,1))
SET ^ESP(912,DA(1),50,DA,2)=$GET(^ESP(910,ESPFN,2))
+3 KILL WIT0,ESPFN
+4 QUIT
VEH ;DISPLAY VEHICLES
+1 SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,80,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 WRITE !?5,NUM," ",$PIECE($GET(^ESP(912,ESPID,80,NUM,0)),U,2)," ",$PIECE($GET(^DIC(5,+$PIECE($GET(^(0)),U,3),0)),U,2)
End DoDot:1
+4 KILL ESPN,NUM
+5 QUIT
LOST ;DISPLAY LOST PROPERTY
+1 SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,90,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 WRITE !?5,NUM," ",$PIECE($GET(^ESP(912,ESPID,90,NUM,0)),U)," "
End DoDot:1
+4 KILL ESPN,NUM
+5 QUIT
HELD ;DISPLAY PROPERTY (HELD)
+1 SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,100,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 WRITE !?5,NUM," ",$PIECE($GET(^ESP(912,ESPID,100,NUM,0)),U,2)," ",$PIECE($GET(^(0)),U,3)
End DoDot:1
+4 KILL ESPN,NUM
+5 QUIT
OTH ;DISPLAY OTHER AGENCIES NOTIFICATIONS
+1 SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,110,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 WRITE !?5,NUM," "
SET Y=$PIECE($GET(^ESP(912,ESPID,110,NUM,0)),U)
XECUTE ^DD("DD")
WRITE Y
End DoDot:1
+4 KILL ESPN,NUM,Y
+5 QUIT
ATTY ;DISPLAY U.S ATTORNEY NOTIFICATIONS
+1 SET NUM=0
SET ESPID=DA
+2 FOR ESPN=0:0
SET NUM=$ORDER(^ESP(912,ESPID,120,NUM))
if NUM'>0
QUIT
Begin DoDot:1
+3 WRITE !?5,NUM," "
SET Y=$PIECE($GET(^ESP(912,ESPID,120,NUM,0)),U)
XECUTE ^DD("DD")
WRITE Y
End DoDot:1
+4 KILL ESPN,NUM,Y
+5 QUIT
NUM SET NEWNUM=NUM+1
SET DIR("A")="Enter "_NEWNUM_" to add a new entry"
SET DIR(0)="N^"_NEWNUM_":"_NEWNUM_":0^"
SET DIR("??")="^W !?5,""Enter "_NEWNUM_" to add a new entry."""
+1 DO ^DIR
if $DATA(DIRUT)
KILL X
KILL DIR,ESPNAM(NEWNUM),NEWNUM
+2 QUIT
UNKN ;Ask if unknown if offender
+1 SET DIR(0)="Y"
SET DIR("A")="Is this an unknown offender"
SET DIR("B")="NO"
+2 DO ^DIR
KILL DIR
+3 IF 'Y
SET ESPNAM(DA)=""
SET Y=.02
QUIT
+4 IF Y
SET ESPNAM(DA)="UNKNOWN"
SET Y=.03
+5 QUIT