ESPOFFDE ;DALISC/CKA- DELETE AN OFFENSE REPORT;8/92
;;1.0;POLICE & SECURITY;40;Mar 31, 1994
EN ;This program allows a person holding the ESP CHIEF key to delete
;an offense report. The program sets the deleted/reopened flag
;and stores the date/time and user # of the person deleting the
;report. It does not REALLY delete the report; it logically deletes
;the report.
;** The offense report to be deleted *MUST* be closed prior to deleting.
UOR S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,2),$P(^(5),U,5)",DIC="^ESP(912,"
D ^DIC
G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
G:Y<0 OR
I $P(^ESP(912,+Y,0),U,8)'="C" W !,$C(7),"Cannot delete an 'open' UOR#, must close first." G UOR
S ESPDTR=$P(^ESP(912,+Y,0),U,2),(ESPID,ESPOFN)=+Y
ASK S DIR(0)="Y",DIR("A")="Are you sure you want to delete this offense report",DIR("B")="NO" D ^DIR K DIR
G:$D(DTOUT) EXIT
G:'Y EXIT
DEL ;DELETE REPORT
D NOW^%DTC S ESPNOW=%
S $P(^ESP(912,ESPOFN,5),U,5)="D",$P(^(5),U,6)=ESPNOW,$P(^(5),U,7)=DUZ
W !!,"The report is deleted."
EXIT W:$D(DTOUT) $C(7)
K DIC,DTOUT,DUOUT,ESPDTR,ESPID,ESPN,ESPNOW,ESPOFN,Y Q
OR W !,$C(7),"I could not find this UOR#. Try again."
G UOR
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPOFFDE 1208 printed Dec 13, 2024@02:29:55 Page 2
ESPOFFDE ;DALISC/CKA- DELETE AN OFFENSE REPORT;8/92
+1 ;;1.0;POLICE & SECURITY;40;Mar 31, 1994
EN ;This program allows a person holding the ESP CHIEF key to delete
+1 ;an offense report. The program sets the deleted/reopened flag
+2 ;and stores the date/time and user # of the person deleting the
+3 ;report. It does not REALLY delete the report; it logically deletes
+4 ;the report.
+5 ;** The offense report to be deleted *MUST* be closed prior to deleting.
UOR SET DIC(0)="QAEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),$P(^(5),U,2),$P(^(5),U,5)"
SET DIC="^ESP(912,"
+1 DO ^DIC
+2 if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
+3 if Y<0
GOTO OR
+4 IF $PIECE(^ESP(912,+Y,0),U,8)'="C"
WRITE !,$CHAR(7),"Cannot delete an 'open' UOR#, must close first."
GOTO UOR
+5 SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET (ESPID,ESPOFN)=+Y
ASK SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to delete this offense report"
SET DIR("B")="NO"
DO ^DIR
KILL DIR
+1 if $DATA(DTOUT)
GOTO EXIT
+2 if 'Y
GOTO EXIT
DEL ;DELETE REPORT
+1 DO NOW^%DTC
SET ESPNOW=%
+2 SET $PIECE(^ESP(912,ESPOFN,5),U,5)="D"
SET $PIECE(^(5),U,6)=ESPNOW
SET $PIECE(^(5),U,7)=DUZ
+3 WRITE !!,"The report is deleted."
EXIT if $DATA(DTOUT)
WRITE $CHAR(7)
+1 KILL DIC,DTOUT,DUOUT,ESPDTR,ESPID,ESPN,ESPNOW,ESPOFN,Y
QUIT
OR WRITE !,$CHAR(7),"I could not find this UOR#. Try again."
+1 GOTO UOR
+2 QUIT