ESPQNC ;Albany/VAD - QUICK NAME CHECK ; 11/27/07 2:15pm
;;1.0;POLICE & SECURITY;**2,18,21,29,45**;Mar 31, 1994;Build 1
START W !! S DIC("A")="Select Name: ",DIC="^ESP(910,",DIC(0)="AEMQZ" D ^DIC I Y<0 G EXIT
S ESPNAM=+Y W !?5,"SEX: ",$P(^ESP(910,ESPNAM,0),"^",8),?20,"RACE: ",$S($D(^DIC(10,+$P(^(0),"^",9),0)):$P(^DIC(10,+$P(^ESP(910,ESPNAM,0),"^",9),0),"^",1),1:""),!!
S ESPN=0,ESPCNT=0,ESPSTP=0,ESPLAST=0
S ESPL=9
REG ;
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(910.2,"D",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". " S REG0=^ESP(910.2,ESPI,0),ESPREG(ESPN)=ESPI W $P("VEHICLE^BICYCLE^WEAPON^PET^GOLF","^",$P(REG0,"^",4))," REGISTRATION ",$P(REG0,"^",1)," ",$P($G(^ESP(910.7,+$P(REG0,"^",2),0)),U)
. I ESPCNT>ESPL S ESPR=ESPN D SELX
S ESPR=$G(ESPN)
G:ESPSTP START
VIO ;
S ESPJ=0 F ESPJ1=1:1 S ESPJ=$O(^ESP(914,"E",ESPNAM,ESPJ)) Q:ESPJ=""!ESPSTP D
. S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". VIOLATION-" S VIO0=^ESP(914,ESPJ,0),ESPVIO(ESPN)=ESPJ S Y=$P(^(0),U,2) X ^DD("DD") W " ",Y W " ",$P($G(^ESP(915,$P(^ESP(914,ESPJ,0),U,4),0)),U)
. I ESPCNT>ESPL S ESPV=ESPN D SELX
S ESPV=$G(ESPN)
G:ESPSTP START
OFF ;
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(912,"D",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. S OFF0=^ESP(912,ESPI,0) I $P(^(5),U,2),$P(^(5),U,5),'$P(^(5),U,4) S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". OFFENSE COMPLAINANT- " S (ESPDTR,X)=$P(^ESP(912,ESPI,0),U,2) W $$CONV^ESPUOR(X) D CL S ESPOFF(ESPN)=ESPI
. I ESPCNT>ESPL S ESPO=ESPN D SELX
G:ESPSTP START
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(912,"E",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. I $P(^ESP(912,ESPI,5),U,2),$P(^(5),U,5),'$P(^(5),U,4) S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". OFFENSE VICTIM- " S (ESPDTR,X)=$P(^ESP(912,ESPI,0),U,2) W $$CONV^ESPUOR(X) D CL S ESPOFF(ESPN)=ESPI
. I ESPCNT>ESPL S ESPO=ESPN D SELX
G:ESPSTP START
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(912,"G",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. I $P(^ESP(912,ESPI,5),U,2),$P(^(5),U,5),'$P(^(5),U,4) S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". OFFENSE OFFENDER- " S (ESPDTR,X)=$P(^ESP(912,ESPI,0),U,2) W $$CONV^ESPUOR(X) D CL S ESPOFF(ESPN)=ESPI
. I ESPCNT>ESPL S ESPO=ESPN D SELX
G:ESPSTP START
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(912,"I",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. I $P(^ESP(912,ESPI,5),U,2),$P(^(5),U,5),'$P(^(5),U,4) S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". OFFENSE WITNESS- " S (ESPDTR,X)=$P(^ESP(912,ESPI,0),U,2) W $$CONV^ESPUOR(X) D CL S ESPOFF(ESPN)=ESPI
. I ESPCNT>ESPL S ESPO=ESPN D SELX
S ESPO=$G(ESPN)
G:ESPSTP START
WAR ;
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(913,"B",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. S ESPN=ESPN+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". " S WAR0=^ESP(913,ESPI,0),ESPWAR(ESPN)=ESPI W "WANT OR WARRANT " S Y=$P(WAR0,U) X ^DD("DD") W Y," ",$P(WAR0,U,6)
. I ESPCNT>ESPL S ESPW=ESPN D SELX
S ESPW=$G(ESPN)
G:ESPSTP START
EVID ;
S ESPI=0 F ESPI1=1:1 S ESPI=$O(^ESP(910.8,"C",ESPNAM,ESPI)) Q:ESPI=""!ESPSTP D
. S EVI0=^ESP(910.8,ESPI,0) I '$P(^(0),U,4) S ESPN=ESPN+1,ESPEVI(ESPN)=ESPI,ESPCNT=ESPCNT+1 W !?5,ESPN,". EVIDENCE RECORD NUMBER ",$P(^(0),U)," ",$P($G(^ESP(910.8,ESPI,10)),U)
. I ESPCNT>ESPL S ESPE=ESPN D SELX
S ESPE=$G(ESPN)
G:ESPSTP START
S ESPN=$G(ESPN)+1,ESPCNT=ESPCNT+1 W !?5,ESPN,". " W "MASTER NAME INDEX RECORD" S ESPLAST=1
D SELX
G START
;
SELX ;
Q:ESPSTP W ! S DIR(0)="NO^1:"_ESPN,DIR("A")="Select a number for viewing, ^ to exit"
I 'ESPLAST S DIR("A")=DIR("A")_", <RETURN> for more"
D ^DIR S ESPX=X W !
I $D(DTOUT) S ESPSTP=1 Q
I X["^" S ESPSTP=1 Q
I X=""&'ESPLAST S ESPSTP=0,ESPCNT=0 Q
I X=""&ESPLAST S ESPSTP=1 Q
S ESPSTP=1
; ===================================================================
;S %ZIS="Q" D ^%ZIS I POP S ESPSTP=1 Q
;I '$D(IO("Q")) U IO D DISP D:IO'=IO(0) ^%ZISC Q
;S ZTRTN="DISP^ESPQNC",ZTSAVE("ESP*")="",ZTDESC="QUICK NAME CHECK" D ^%ZTLOAD,HOME^%ZIS
; -------------------------------------------------------------------
; The following lines replace the lines above.
; -------------------------------------------------------------------
N ZTRTN,ZTSAVE,ZTDESC
S ZTRTN="DISP^ESPQNC",ZTSAVE("ESP*")="",ZTDESC="QUICK NAME CHECK"
W ! D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
; ===================================================================
Q
;
DISP ;
I ESPX<ESPR!(ESPX=ESPR) S DA=ESPREG(ESPX),DIC="^ESP(910.2," D EN^DIQ Q
I ESPX>ESPR,ESPX<ESPV!(ESPX=ESPV) S ESPID=ESPVIO(ESPX) D START^ESPVNP Q
I ESPX>ESPV,ESPX<ESPO!(ESPX=ESPO) S ESPID=ESPOFF(ESPX),ESPDTR=$P(^ESP(912,ESPID,0),U,2) D START^ESPORP Q
I ESPX>ESPO,ESPX<ESPW!(ESPX=ESPW) S DA=ESPWAR(ESPX),DIC="^ESP(913," D EN^DIQ Q
I ESPX>ESPW,ESPX<ESPE!(ESPX=ESPE) S DA=ESPEVI(ESPX),DIC="^ESP(910.8," D EN^DIQ Q
I ESPX=ESPN S DA=ESPNAM,DIC="^ESP(910," D EN^DIQ Q
;
EXIT ;
K %ZIS,DA,DIC,DIQ,DIR,DR,DTOUT,ESPDTR,ESPE,ESPEVI,ESPFN,ESPI,ESPI1,ESPID,ESPJ,ESPJ1,ESPN,ESPNAM,ESPO,ESPOFF,ESPR,ESPREG,ESPV,ESPVIO,ESPW,ESPWAR,ESPX,ESPZ,EVI0,OFF0,REG0,VIO0,WAR0,X,Y,ESPCNT,ESPSTP,ESPL,ESPLAST
Q
;
CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
F ESPZ=0:0 S ESPZ=$O(^ESP(912,ESPI,10,ESPZ)) Q:ESPZ'>0 D
. S DIC="^ESP(912,"_ESPI_",10,",DA=ESPZ,DR=".01;.02;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
. W " ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
. I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
. I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
. K DIC,DR
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPQNC 5469 printed Dec 13, 2024@02:30:14 Page 2
ESPQNC ;Albany/VAD - QUICK NAME CHECK ; 11/27/07 2:15pm
+1 ;;1.0;POLICE & SECURITY;**2,18,21,29,45**;Mar 31, 1994;Build 1
START WRITE !!
SET DIC("A")="Select Name: "
SET DIC="^ESP(910,"
SET DIC(0)="AEMQZ"
DO ^DIC
IF Y<0
GOTO EXIT
+1 SET ESPNAM=+Y
WRITE !?5,"SEX: ",$PIECE(^ESP(910,ESPNAM,0),"^",8),?20,"RACE: ",$SELECT($DATA(^DIC(10,+$PIECE(^(0),"^",9),0)):$PIECE(^DIC(10,+$PIECE(^ESP(910,ESPNAM,0),"^",9),0),"^",1),1:""),!!
+2 SET ESPN=0
SET ESPCNT=0
SET ESPSTP=0
SET ESPLAST=0
+3 SET ESPL=9
REG ;
+1 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(910.2,"D",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+2 SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". "
SET REG0=^ESP(910.2,ESPI,0)
SET ESPREG(ESPN)=ESPI
WRITE $PIECE("VEHICLE^BICYCLE^WEAPON^PET^GOLF","^",$PIECE(REG0,"^",4))," REGISTRATION ",$PIECE(REG0,"^",1)," ",$PIECE($GET(^ESP(910.7,+$PIECE(REG0,"^",2),0)),U)
+3 IF ESPCNT>ESPL
SET ESPR=ESPN
DO SELX
End DoDot:1
+4 SET ESPR=$GET(ESPN)
+5 if ESPSTP
GOTO START
VIO ;
+1 SET ESPJ=0
FOR ESPJ1=1:1
SET ESPJ=$ORDER(^ESP(914,"E",ESPNAM,ESPJ))
if ESPJ=""!ESPSTP
QUIT
Begin DoDot:1
+2 SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". VIOLATION-"
SET VIO0=^ESP(914,ESPJ,0)
SET ESPVIO(ESPN)=ESPJ
SET Y=$PIECE(^(0),U,2)
XECUTE ^DD("DD")
WRITE " ",Y
WRITE " ",$PIECE($GET(^ESP(915,$PIECE(^ESP(914,ESPJ,0),U,4),0)),U)
+3 IF ESPCNT>ESPL
SET ESPV=ESPN
DO SELX
End DoDot:1
+4 SET ESPV=$GET(ESPN)
+5 if ESPSTP
GOTO START
OFF ;
+1 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(912,"D",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+2 SET OFF0=^ESP(912,ESPI,0)
IF $PIECE(^(5),U,2)
IF $PIECE(^(5),U,5)
IF '$PIECE(^(5),U,4)
SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". OFFENSE COMPLAINANT- "
SET (ESPDTR,X)=$PIECE(^ESP(912,ESPI,0),U,2)
WRITE $$CONV^ESPUOR(X)
DO CL
SET ESPOFF(ESPN)=ESPI
+3 IF ESPCNT>ESPL
SET ESPO=ESPN
DO SELX
End DoDot:1
+4 if ESPSTP
GOTO START
+5 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(912,"E",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+6 IF $PIECE(^ESP(912,ESPI,5),U,2)
IF $PIECE(^(5),U,5)
IF '$PIECE(^(5),U,4)
SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". OFFENSE VICTIM- "
SET (ESPDTR,X)=$PIECE(^ESP(912,ESPI,0),U,2)
WRITE $$CONV^ESPUOR(X)
DO CL
SET ESPOFF(ESPN)=ESPI
+7 IF ESPCNT>ESPL
SET ESPO=ESPN
DO SELX
End DoDot:1
+8 if ESPSTP
GOTO START
+9 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(912,"G",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+10 IF $PIECE(^ESP(912,ESPI,5),U,2)
IF $PIECE(^(5),U,5)
IF '$PIECE(^(5),U,4)
SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". OFFENSE OFFENDER- "
SET (ESPDTR,X)=$PIECE(^ESP(912,ESPI,0),U,2)
WRITE $$CONV^ESPUOR(X)
DO CL
SET ESPOFF(ESPN)=ESPI
+11 IF ESPCNT>ESPL
SET ESPO=ESPN
DO SELX
End DoDot:1
+12 if ESPSTP
GOTO START
+13 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(912,"I",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+14 IF $PIECE(^ESP(912,ESPI,5),U,2)
IF $PIECE(^(5),U,5)
IF '$PIECE(^(5),U,4)
SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". OFFENSE WITNESS- "
SET (ESPDTR,X)=$PIECE(^ESP(912,ESPI,0),U,2)
WRITE $$CONV^ESPUOR(X)
DO CL
SET ESPOFF(ESPN)=ESPI
+15 IF ESPCNT>ESPL
SET ESPO=ESPN
DO SELX
End DoDot:1
+16 SET ESPO=$GET(ESPN)
+17 if ESPSTP
GOTO START
WAR ;
+1 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(913,"B",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+2 SET ESPN=ESPN+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". "
SET WAR0=^ESP(913,ESPI,0)
SET ESPWAR(ESPN)=ESPI
WRITE "WANT OR WARRANT "
SET Y=$PIECE(WAR0,U)
XECUTE ^DD("DD")
WRITE Y," ",$PIECE(WAR0,U,6)
+3 IF ESPCNT>ESPL
SET ESPW=ESPN
DO SELX
End DoDot:1
+4 SET ESPW=$GET(ESPN)
+5 if ESPSTP
GOTO START
EVID ;
+1 SET ESPI=0
FOR ESPI1=1:1
SET ESPI=$ORDER(^ESP(910.8,"C",ESPNAM,ESPI))
if ESPI=""!ESPSTP
QUIT
Begin DoDot:1
+2 SET EVI0=^ESP(910.8,ESPI,0)
IF '$PIECE(^(0),U,4)
SET ESPN=ESPN+1
SET ESPEVI(ESPN)=ESPI
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". EVIDENCE RECORD NUMBER ",$PIECE(^(0),U)," ",$PIECE($GET(^ESP(910.8,ESPI,10)),U)
+3 IF ESPCNT>ESPL
SET ESPE=ESPN
DO SELX
End DoDot:1
+4 SET ESPE=$GET(ESPN)
+5 if ESPSTP
GOTO START
+6 SET ESPN=$GET(ESPN)+1
SET ESPCNT=ESPCNT+1
WRITE !?5,ESPN,". "
WRITE "MASTER NAME INDEX RECORD"
SET ESPLAST=1
+7 DO SELX
+8 GOTO START
+9 ;
SELX ;
+1 if ESPSTP
QUIT
WRITE !
SET DIR(0)="NO^1:"_ESPN
SET DIR("A")="Select a number for viewing, ^ to exit"
+2 IF 'ESPLAST
SET DIR("A")=DIR("A")_", <RETURN> for more"
+3 DO ^DIR
SET ESPX=X
WRITE !
+4 IF $DATA(DTOUT)
SET ESPSTP=1
QUIT
+5 IF X["^"
SET ESPSTP=1
QUIT
+6 IF X=""&'ESPLAST
SET ESPSTP=0
SET ESPCNT=0
QUIT
+7 IF X=""&ESPLAST
SET ESPSTP=1
QUIT
+8 SET ESPSTP=1
+9 ; ===================================================================
+10 ;S %ZIS="Q" D ^%ZIS I POP S ESPSTP=1 Q
+11 ;I '$D(IO("Q")) U IO D DISP D:IO'=IO(0) ^%ZISC Q
+12 ;S ZTRTN="DISP^ESPQNC",ZTSAVE("ESP*")="",ZTDESC="QUICK NAME CHECK" D ^%ZTLOAD,HOME^%ZIS
+13 ; -------------------------------------------------------------------
+14 ; The following lines replace the lines above.
+15 ; -------------------------------------------------------------------
+16 NEW ZTRTN,ZTSAVE,ZTDESC
+17 SET ZTRTN="DISP^ESPQNC"
SET ZTSAVE("ESP*")=""
SET ZTDESC="QUICK NAME CHECK"
+18 WRITE !
DO EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
+19 ; ===================================================================
+20 QUIT
+21 ;
DISP ;
+1 IF ESPX<ESPR!(ESPX=ESPR)
SET DA=ESPREG(ESPX)
SET DIC="^ESP(910.2,"
DO EN^DIQ
QUIT
+2 IF ESPX>ESPR
IF ESPX<ESPV!(ESPX=ESPV)
SET ESPID=ESPVIO(ESPX)
DO START^ESPVNP
QUIT
+3 IF ESPX>ESPV
IF ESPX<ESPO!(ESPX=ESPO)
SET ESPID=ESPOFF(ESPX)
SET ESPDTR=$PIECE(^ESP(912,ESPID,0),U,2)
DO START^ESPORP
QUIT
+4 IF ESPX>ESPO
IF ESPX<ESPW!(ESPX=ESPW)
SET DA=ESPWAR(ESPX)
SET DIC="^ESP(913,"
DO EN^DIQ
QUIT
+5 IF ESPX>ESPW
IF ESPX<ESPE!(ESPX=ESPE)
SET DA=ESPEVI(ESPX)
SET DIC="^ESP(910.8,"
DO EN^DIQ
QUIT
+6 IF ESPX=ESPN
SET DA=ESPNAM
SET DIC="^ESP(910,"
DO EN^DIQ
QUIT
+7 ;
EXIT ;
+1 KILL %ZIS,DA,DIC,DIQ,DIR,DR,DTOUT,ESPDTR,ESPE,ESPEVI,ESPFN,ESPI,ESPI1,ESPID,ESPJ,ESPJ1,ESPN,ESPNAM,ESPO,ESPOFF,ESPR,ESPREG,ESPV,ESPVIO,ESPW,ESPWAR,ESPX,ESPZ,EVI0,OFF0,REG0,VIO0,WAR0,X,Y,ESPCNT,ESPSTP,ESPL,ESPLAST
+2 QUIT
+3 ;
CL ;PRINT CLASSIFICATION CODES, TYPES, AND SUBTYPES
+1 FOR ESPZ=0:0
SET ESPZ=$ORDER(^ESP(912,ESPI,10,ESPZ))
if ESPZ'>0
QUIT
Begin DoDot:1
+2 SET DIC="^ESP(912,"_ESPI_",10,"
SET DA=ESPZ
SET DR=".01;.02;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
QUIT
+3 WRITE " ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+4 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+5 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.03,"E"))]""
WRITE "/",^("E")
+6 KILL DIC,DR
End DoDot:1
+7 QUIT