ESPMNI ;DALISC/CKA - MASTER NAME INPUT;5/92
;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
;Called from ^ESPOFF,
;ESPVAR=1 Master Name Input
;ESPVAR=2 Vehicle Registration
;ESPVAR=3 Offense Report
;ESPVAR=4 Violation Notice
;returns ESPFN- internal entry # of Master Name Index file
S:'$D(ESPVAR) ESPVAR=1 S ESPNO=0 D DT^DICRW F I=.01:.01:.11 S ESPD(I)="",ESPD(I,"P")=""
F I=1.01:.01:1.06 S ESPD(I)="",ESPD(I,"P")=""
F I=2.01:.01:2.06 S ESPD(I)="",ESPD(I,"P")=""
F I=3.01:.01:3.06 S ESPD(I)="",ESPD(I,"P")=""
X S DIR(0)="FO^1:30",DIR("A")="NAME",DIR("?")="Enter the name in'Last,First Middle' format [<30 characters]. You may also enter part of the name for lookup purposes",DIR("??")="^S D=""B"",DIC=""^ESP(910,"",DIC(0)=""EZ"" D DQ^DICQ K DIC"
D ^DIR K DIR I $D(DIRUT) K ESPFN G EXIT
S ESPX=Y
LKUP S DIC="^ESP(910,",DIC(0)="EMZ" D ^DIC K DIC S ESPFN=+Y
I $D(DTOUT) G NOU
I Y'<0 D FND G:Y["^"!($D(DTOUT)) NOU G:ESPNO ADD G:ESPVAR=1&('Y) EN G:ESPVAR=2&('Y) NUM^ESPVREG G:ESPVAR=3&('Y) RET G:ESPVAR=4&('Y) RETV D FDISP^ESPMNI2 G:$D(DTOUT) EXIT G:ESPVAR=1 EN G:ESPVAR=2 NUM^ESPVREG G:ESPVAR=3 RET G:ESPVAR=4 RETV G EXIT
I Y<0 W !! G:$D(DUOUT) X
S DIC(0)="E" D LAYGO^ESPXREF W !! G:$D(ESPOUT) EXIT G:'X X G:X NAME
ADD S DIR(0)="Y",DIR("A")="Do you want to add this name",DIR("B")="YES" D ^DIR G:$D(DIRUT) NOU K DIR
I 'Y G X
NAME D ^ESPMNI0 G:$D(DUOUT)!('$D(ESPFN)) EN G:$D(DTOUT) EXIT
G CONT^ESPMNI1
EXIT W:$D(DTOUT) $C(7)
K %X,%Y,DA,DIC,DIR,DIRUT,DIWF,DIWL,DIWR,DUOUT,ESPAKA,ESPD,ESPDOB,ESPOUT,ESPJ,ESPNO,ESPX,I,IEN,X,Y,^TMP($J,"MNI")
I ESPVAR=1 K ESPFN,ESPVAR
QUIT
NOU W !!,$C(7),?20,"NO UPDATING HAS OCCURRED!!!",!! K DIR,ESPAKA,ESPD,^TMP($J,"MNI") G:$D(DTOUT) EXIT G EN
FND ;this entry exists already
S Y=$P(Y(0),U,3) D DD^%DT S ESPDOB=Y,ESPNO=0
W !!,"This name is already in the Master Name Index file.",!!?5,"Name: ",$P(Y(0),U),?40,"SSN: ",$P(Y(0),U,2),!?5,"DOB: ",ESPDOB,?25,"SEX: ",$P(Y(0),U,8),?35,"RACE: ",$S($D(^DIC(10,+$P(Y(0),U,9),0)):$P(^DIC(10,+$P(Y(0),U,9),0),U),1:""),!
S DIR(0)="Y",DIR("A")="Is this the correct one" D ^DIR K DIR
I 'Y S ESPNO=1 Q
YN1 S DIR(0)="Y",DIR("A")="Do you want to edit this record",DIR("B")="NO" D ^DIR K DIR W !! Q
RET W !,"Now returning to the Offense Report!" G EXIT
RETV W !,"Now returning to the Violation Notice!" G EXIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPMNI 2328 printed Dec 13, 2024@02:29:44 Page 2
ESPMNI ;DALISC/CKA - MASTER NAME INPUT;5/92
+1 ;;1.0;POLICE & SECURITY;;Mar 31, 1994
EN ;
+1 ;Called from ^ESPOFF,
+2 ;ESPVAR=1 Master Name Input
+3 ;ESPVAR=2 Vehicle Registration
+4 ;ESPVAR=3 Offense Report
+5 ;ESPVAR=4 Violation Notice
+6 ;returns ESPFN- internal entry # of Master Name Index file
+7 if '$DATA(ESPVAR)
SET ESPVAR=1
SET ESPNO=0
DO DT^DICRW
FOR I=.01:.01:.11
SET ESPD(I)=""
SET ESPD(I,"P")=""
+8 FOR I=1.01:.01:1.06
SET ESPD(I)=""
SET ESPD(I,"P")=""
+9 FOR I=2.01:.01:2.06
SET ESPD(I)=""
SET ESPD(I,"P")=""
+10 FOR I=3.01:.01:3.06
SET ESPD(I)=""
SET ESPD(I,"P")=""
X SET DIR(0)="FO^1:30"
SET DIR("A")="NAME"
SET DIR("?")="Enter the name in'Last,First Middle' format [<30 characters]. You may also enter part of the name for lookup purposes"
SET DIR("??")="^S D=""B"",DIC=""^ESP(910,"",DIC(0)=""EZ"" D DQ^DICQ K DIC"
+1 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
KILL ESPFN
GOTO EXIT
+2 SET ESPX=Y
LKUP SET DIC="^ESP(910,"
SET DIC(0)="EMZ"
DO ^DIC
KILL DIC
SET ESPFN=+Y
+1 IF $DATA(DTOUT)
GOTO NOU
+2 IF Y'<0
DO FND
if Y["^"!($DATA(DTOUT))
GOTO NOU
if ESPNO
GOTO ADD
if ESPVAR=1&('Y)
GOTO EN
if ESPVAR=2&('Y)
GOTO NUM^ESPVREG
if ESPVAR=3&('Y)
GOTO RET
if ESPVAR=4&('Y)
GOTO RETV
DO FDISP^ESPMNI2
if $DATA(DTOUT)
GOTO EXIT
if ESPVAR=1
GOTO EN
if ESPVAR=2
GOTO NUM^ESPVREG
if ESPVAR=3
GOTO RET
if ESPVAR=4
GOTO RETV
GOTO EXIT
+3 IF Y<0
WRITE !!
if $DATA(DUOUT)
GOTO X
+4 SET DIC(0)="E"
DO LAYGO^ESPXREF
WRITE !!
if $DATA(ESPOUT)
GOTO EXIT
if 'X
GOTO X
if X
GOTO NAME
ADD SET DIR(0)="Y"
SET DIR("A")="Do you want to add this name"
SET DIR("B")="YES"
DO ^DIR
if $DATA(DIRUT)
GOTO NOU
KILL DIR
+1 IF 'Y
GOTO X
NAME DO ^ESPMNI0
if $DATA(DUOUT)!('$DATA(ESPFN))
GOTO EN
if $DATA(DTOUT)
GOTO EXIT
+1 GOTO CONT^ESPMNI1
EXIT if $DATA(DTOUT)
WRITE $CHAR(7)
+1 KILL %X,%Y,DA,DIC,DIR,DIRUT,DIWF,DIWL,DIWR,DUOUT,ESPAKA,ESPD,ESPDOB,ESPOUT,ESPJ,ESPNO,ESPX,I,IEN,X,Y,^TMP($JOB,"MNI")
+2 IF ESPVAR=1
KILL ESPFN,ESPVAR
+3 QUIT
NOU WRITE !!,$CHAR(7),?20,"NO UPDATING HAS OCCURRED!!!",!!
KILL DIR,ESPAKA,ESPD,^TMP($JOB,"MNI")
if $DATA(DTOUT)
GOTO EXIT
GOTO EN
FND ;this entry exists already
+1 SET Y=$PIECE(Y(0),U,3)
DO DD^%DT
SET ESPDOB=Y
SET ESPNO=0
+2 WRITE !!,"This name is already in the Master Name Index file.",!!?5,"Name: ",$PIECE(Y(0),U),?40,"SSN: ",$PIECE(Y(0),U,2),!?5,"DOB: ",ESPDOB,?25,"SEX: ",$PIECE(Y(0),U,8),?35,"RACE: ",...
... $SELECT($DATA(^DIC(10,+$PIECE(Y(0),U,9),0)):$PIECE(^DIC(10,+$PIECE(Y(0),U,9),0),U),1:""),!
+3 SET DIR(0)="Y"
SET DIR("A")="Is this the correct one"
DO ^DIR
KILL DIR
+4 IF 'Y
SET ESPNO=1
QUIT
YN1 SET DIR(0)="Y"
SET DIR("A")="Do you want to edit this record"
SET DIR("B")="NO"
DO ^DIR
KILL DIR
WRITE !!
QUIT
RET WRITE !,"Now returning to the Offense Report!"
GOTO EXIT
RETV WRITE !,"Now returning to the Violation Notice!"
GOTO EXIT