ESPORO ;DALISC/CKA-OPEN A CLOSED OFFENSE REPORT;11/92
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
D DT^DICRW
OR S DIC(0)="AEMZ",DIC("A")="UOR#: ",DIC("S")="I $D(^(5)),$P(^(5),U,5),$P(^(0),U,8)=""C""",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),(ESPOFN,ESPID)=+Y
OP ;OPEN CLOSED REPORT
D NOW^%DTC
S NOW=X,$P(^ESP(912,ESPID,0),U,8)="O",$P(^(5),U,5)="R"
W !?5,$C(7),"This report is now open and may be edited."
;COPY REOPENED REPORT TO A NEW ID # IN OFFENSE REPORT FILE
K DD,D0 S DIC="^ESP(912,",DIC(0)="L",DLAYGO=912 D OFF^ESPOID D FILE^DICN
S ESPOFN=+Y
L +^ESP(912,ESPOFN):1 I '$T W !,"Another user is editing this record!!"
S %X="^ESP(912,"_ESPID_",",%Y="^ESP(912,"_ESPOFN_"," D %XY^%RCR
S $P(^ESP(912,ESPOFN,0),U)=ESPOFN,$P(^(5),U,5)=1,$P(^(6),U)=ESPID,$P(^(6),U,2)=NOW,$P(^(6),U,3)=DUZ
;CROSS REFERENCES SET
S DIK="^ESP(912,",DA=ESPOFN D IX1^DIK K DIK,DA
L -^ESP(912,ESPOFN)
EDIT ;CALL TO ESPOFFE TO PRINT/EDIT REPORT
S ESPVAR=2,ESPID=ESPOFN D PRT^ESPOFFE
EXIT K %ZIS,DA,DIE,DIR,DIRUT,DR,ESPID,ESPN,ESPOFN,ESPVAR,NOW,POP,Y,ZTDESC,ZTRTN,ZTSAVE Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPORO 1144 printed Nov 22, 2024@17:40:07 Page 2
ESPORO ;DALISC/CKA-OPEN A CLOSED OFFENSE REPORT;11/92
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
+1 DO DT^DICRW
OR SET DIC(0)="AEMZ"
SET DIC("A")="UOR#: "
SET DIC("S")="I $D(^(5)),$P(^(5),U,5),$P(^(0),U,8)=""C"""
SET DIC="^ESP(912,"
+1 DO ^DIC
+2 if $DATA(DTOUT)!($DATA(DUOUT))!(X="")
GOTO EXIT
+3 if Y<0
GOTO OR
SET ESPDTR=$PIECE(^ESP(912,+Y,0),U,2)
SET (ESPOFN,ESPID)=+Y
OP ;OPEN CLOSED REPORT
+1 DO NOW^%DTC
+2 SET NOW=X
SET $PIECE(^ESP(912,ESPID,0),U,8)="O"
SET $PIECE(^(5),U,5)="R"
+3 WRITE !?5,$CHAR(7),"This report is now open and may be edited."
+4 ;COPY REOPENED REPORT TO A NEW ID # IN OFFENSE REPORT FILE
+5 KILL DD,D0
SET DIC="^ESP(912,"
SET DIC(0)="L"
SET DLAYGO=912
DO OFF^ESPOID
DO FILE^DICN
+6 SET ESPOFN=+Y
+7 LOCK +^ESP(912,ESPOFN):1
IF '$TEST
WRITE !,"Another user is editing this record!!"
+8 SET %X="^ESP(912,"_ESPID_","
SET %Y="^ESP(912,"_ESPOFN_","
DO %XY^%RCR
+9 SET $PIECE(^ESP(912,ESPOFN,0),U)=ESPOFN
SET $PIECE(^(5),U,5)=1
SET $PIECE(^(6),U)=ESPID
SET $PIECE(^(6),U,2)=NOW
SET $PIECE(^(6),U,3)=DUZ
+10 ;CROSS REFERENCES SET
+11 SET DIK="^ESP(912,"
SET DA=ESPOFN
DO IX1^DIK
KILL DIK,DA
+12 LOCK -^ESP(912,ESPOFN)
EDIT ;CALL TO ESPOFFE TO PRINT/EDIT REPORT
+1 SET ESPVAR=2
SET ESPID=ESPOFN
DO PRT^ESPOFFE
EXIT KILL %ZIS,DA,DIE,DIR,DIRUT,DR,ESPID,ESPN,ESPOFN,ESPVAR,NOW,POP,Y,ZTDESC,ZTRTN,ZTSAVE
QUIT