ESPREG ;DALISC/CKA- EDIT REGISTRATION PROGRAM ;5/91
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
S DIR(0)="910.2,.04" D ^DIR K DIR G:$D(DIRUT) EXIT S ESPRT=$S($D(Y(0)):Y(0),X'?1N:X,1:""),ESPRT(1)=+Y
NAM W ! S DIR(0)="P^910:EMZ" D ^DIR K DIR G:$D(DIRUT) EXIT S ESPFN=+Y,ESPNAM=$P(Y,U,2) D REG G ESPREG
;
REG S DIR(0)="FO:1:30",DIR("A")="Select VA TAG ID",DIR("?")="^S D=""B"",DZ=""??"",DIC=""^ESP(910.2,"",DIC(0)=""AEQZ"",DIC(""S"")=""I $P(^(0),U,4)=ESPRT(1)&($P(^(0),U,3)=ESPFN)"" D DQ^DICQ K DIC" D ^DIR K DIR G:'Y EXIT
S DIC="^ESP(910.2,",DIC("S")="I $P(^(0),""^"",4)=ESPRT(1)",DIC(0)="E" D ^DIC K DIC G:Y'>0 MES S ESPY=Y I '$D(^ESP(910.2,+Y,0)) W !!,"Invalid selection made...try again please!",$C(7) G REG
DISPLAY ;Show the record to be edited
S DIC="^ESP(910.2,",DA=+ESPY D EN^DIQ
EDIT ;
L +^ESP(910.2,+ESPY):0 E W !!?5,"Record is in use. Try later.",!,$C(7) G REG
S DIE="^ESP(910.2,",DA=+ESPY,DR=".01DECAL NO.;.02:.07",DR=DR_";"_$P($T(DR+ESPRT(1)),";;",2) D ^DIE L -^ESP(910.2,+ESPY) K DR,DIE G:'$D(ESPVAR) REG G EXIT
;
DR ;
;;1.01:1.09;20
;;4.01:4.05;20
;;2.01:2.08;20
;;3.01:3.08;20
;;5.02;20
;;10;5;20
EXIT W:$D(DTOUT) $C(7)
K ESPNAM,ESPRT,ESPRTD,ESPY QUIT
MES ;
I ESPRT(1)=1 W !,$C(7),ESPNAM," does not have a vehicle registered with this decal." E W !,$C(7),ESPNAM," does not have this va tag id."
G REG
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPREG 1359 printed Nov 22, 2024@17:40:18 Page 2
ESPREG ;DALISC/CKA- EDIT REGISTRATION PROGRAM ;5/91
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
+1 SET DIR(0)="910.2,.04"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
SET ESPRT=$SELECT($DATA(Y(0)):Y(0),X'?1N:X,1:"")
SET ESPRT(1)=+Y
NAM WRITE !
SET DIR(0)="P^910:EMZ"
DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
SET ESPFN=+Y
SET ESPNAM=$PIECE(Y,U,2)
DO REG
GOTO ESPREG
+1 ;
REG SET DIR(0)="FO:1:30"
SET DIR("A")="Select VA TAG ID"
SET DIR("?")="^S D=""B"",DZ=""??"",DIC=""^ESP(910.2,"",DIC(0)=""AEQZ"",DIC(""S"")=""I $P(^(0),U,4)=ESPRT(1)&($P(^(0),U,3)=ESPFN)"" D DQ^DICQ K DIC"
DO ^DIR
KILL DIR
if 'Y
GOTO EXIT
+1 SET DIC="^ESP(910.2,"
SET DIC("S")="I $P(^(0),""^"",4)=ESPRT(1)"
SET DIC(0)="E"
DO ^DIC
KILL DIC
if Y'>0
GOTO MES
SET ESPY=Y
IF '$DATA(^ESP(910.2,+Y,0))
WRITE !!,"Invalid selection made...try again please!",$CHAR(7)
GOTO REG
DISPLAY ;Show the record to be edited
+1 SET DIC="^ESP(910.2,"
SET DA=+ESPY
DO EN^DIQ
EDIT ;
+1 LOCK +^ESP(910.2,+ESPY):0
IF '$TEST
WRITE !!?5,"Record is in use. Try later.",!,$CHAR(7)
GOTO REG
+2 SET DIE="^ESP(910.2,"
SET DA=+ESPY
SET DR=".01DECAL NO.;.02:.07"
SET DR=DR_";"_$PIECE($TEXT(DR+ESPRT(1)),";;",2)
DO ^DIE
LOCK -^ESP(910.2,+ESPY)
KILL DR,DIE
if '$DATA(ESPVAR)
GOTO REG
GOTO EXIT
+3 ;
DR ;
+1 ;;1.01:1.09;20
+2 ;;4.01:4.05;20
+3 ;;2.01:2.08;20
+4 ;;3.01:3.08;20
+5 ;;5.02;20
+6 ;;10;5;20
EXIT if $DATA(DTOUT)
WRITE $CHAR(7)
+1 KILL ESPNAM,ESPRT,ESPRTD,ESPY
QUIT
MES ;
+1 IF ESPRT(1)=1
WRITE !,$CHAR(7),ESPNAM," does not have a vehicle registered with this decal."
IF '$TEST
WRITE !,$CHAR(7),ESPNAM," does not have this va tag id."
+2 GOTO REG