ESPOFI ;DALISC/CKA- ENTER/EDIT FOLLOW-UP INVESTIGATION NOTES;5/93
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;This routine allows the officer to enter follow-up investigation notes.
;When the officer hits '??' at the UOR# prompt, he/she will see open offense reports.
START D DT^DICRW
I '$D(^XUSEC("ESP CHIEF",DUZ)) G OR
ORC ;This allows persons holding the ESP CHIEF key to add follow-up notes to sensitive reports
S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,5),$P(^(0),U,8)=""O""",DIC="^ESP(912,"
D ^DIC G:$D(DTOUT)!($D(DUOUT)) EXIT G:Y<0 OR S ESPDTR=$P(^ESP(912,+Y,0),U,2),(ESPID,ESPOFN)=+Y
G DISP
OR ;This allows persons to add follow-up notes to nonsensitive reports
S DIC(0)="QAEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),'$P(^(5),U,4),$P(^(5),U,5)",DIC="^ESP(912,"
D ^DIC
G:$D(DTOUT)!($D(DUOUT))!(X="") EXIT
G:Y<0 OR S ESPDTR=$P(^ESP(912,+Y,0),U,2),(ESPID,ESPOFN)=+Y
I $P(^ESP(912,+Y,0),U,8)="C" W !,$C(7),"This report is closed and follow-up notes cannot be added!" G OR
DISP ;ASK IF WANT TO DISPLAY THIS REPORT
S DIR(0)="Y",DIR("A")="Do you want to print the report first",DIR("B")="NO" D ^DIR K DIR
G:$D(DTOUT) EXIT
I 'Y G EDIT
Q S %ZIS="Q" D ^%ZIS G:POP EXIT I '$D(IO("Q")) U IO D START^ESPORP G EDIT
S ZTRTN="START^ESPORP",ZTSAVE("ESP*")="",ZTDESC="OFFENSE REPORT" D ^%ZTLOAD,HOME^%ZIS
W !!!!
G:$D(DTOUT) EXIT
EDIT ;ADD/EDIT FOLLOW-UP NOTES
D DT^DICRW
S DIE="^ESP(912,",DA=ESPOFN,DIE("NO^")="OUTOK",DR="[ESP FOLLOW-UP NOTES"
L +^ESP(912,DA):1 I '$T W !,"Another user is editing this record!!" G EXIT
D ^DIE
L -^ESP(912,ESPOFN)
EXIT W:$D(DTOUT) $C(7)
K %ZIS,DA,DD,DIC,DIE,DIR,DO,DR,DTOUT,DUOUT,ESPDTR,ESPID,ESPOFN,X,Y Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPOFI 1706 printed Dec 13, 2024@02:29:57 Page 2
ESPOFI ;DALISC/CKA- ENTER/EDIT FOLLOW-UP INVESTIGATION NOTES;5/93
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;This routine allows the officer to enter follow-up investigation notes.
+1 ;When the officer hits '??' at the UOR# prompt, he/she will see open offense reports.
START DO DT^DICRW
+1 IF '$DATA(^XUSEC("ESP CHIEF",DUZ))
GOTO OR
ORC ;This allows persons holding the ESP CHIEF key to add follow-up notes to sensitive reports
+1 SET DIC(0)="QAEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),$P(^(5),U,5),$P(^(0),U,8)=""O"""
SET DIC="^ESP(912,"
+2 DO ^DIC
if $DATA(DTOUT)!($DATA(DUOUT))
GOTO EXIT
if Y<0
GOTO OR
SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET (ESPID,ESPOFN)=+Y
+3 GOTO DISP
OR ;This allows persons to add follow-up notes to nonsensitive reports
+1 SET DIC(0)="QAEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),'$P(^(5),U,4),$P(^(5),U,5)"
SET DIC="^ESP(912,"
+2 DO ^DIC
+3 if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
+4 if Y<0
GOTO OR
SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET (ESPID,ESPOFN)=+Y
+5 IF $PIECE(^ESP(912,+Y,0),U,8)="C"
WRITE !,$CHAR(7),"This report is closed and follow-up notes cannot be added!"
GOTO OR
DISP ;ASK IF WANT TO DISPLAY THIS REPORT
+1 SET DIR(0)="Y"
SET DIR("A")="Do you want to print the report first"
SET DIR("B")="NO"
DO ^DIR
KILL DIR
+2 if $DATA(DTOUT)
GOTO EXIT
+3 IF 'Y
GOTO EDIT
Q SET %ZIS="Q"
DO ^%ZIS
if POP
GOTO EXIT
IF '$DATA(IO("Q"))
USE IO
DO START^ESPORP
GOTO EDIT
+1 SET ZTRTN="START^ESPORP"
SET ZTSAVE("ESP*")=""
SET ZTDESC="OFFENSE REPORT"
DO ^%ZTLOAD
DO HOME^%ZIS
+2 WRITE !!!!
+3 if $DATA(DTOUT)
GOTO EXIT
EDIT ;ADD/EDIT FOLLOW-UP NOTES
+1 DO DT^DICRW
+2 SET DIE="^ESP(912,"
SET DA=ESPOFN
SET DIE("NO^")="OUTOK"
SET DR="[ESP FOLLOW-UP NOTES"
+3 LOCK +^ESP(912,DA):1
IF '$TEST
WRITE !,"Another user is editing this record!!"
GOTO EXIT
+4 DO ^DIE
+5 LOCK -^ESP(912,ESPOFN)
EXIT if $DATA(DTOUT)
WRITE $CHAR(7)
+1 KILL %ZIS,DA,DD,DIC,DIE,DIR,DO,DR,DTOUT,DUOUT,ESPDTR,ESPID,ESPOFN,X,Y
QUIT