ESPUTIL ;DALISC/CKA- CONVERTS UOR # TO DESIRED FORMAT & ZIP CODE TRANSFORMS;3/93
;;1.0;POLICE & SECURITY;**14,17,22**;Mar 31, 1994
EN ;Miscellaneous
UORN ;This is to get a UOR# fm 18 doesn't allow 1990 standard
S X=$$CONV^ESPUOR($P(^ESP(912,D0,0),U,2))
Q
XR ;This is to get a UOR# for UOR xref on DATE/TIME RECEIVED field
S ESPUOR=$$CONV^ESPUOR(X)
Q
;This routine contains generic input and output transforms for the
;ZIP + extension fields which reside in DHCP
;
ZIPIN ; input transform for ZIP - massages user input and returns data
; in Fileman internal format (no '-'s)
;
; Input: X as user entered value
; Output: X as internal value of user input OR
; undefines if input from user was invalid
;
N %
I X'?.N F %=1:1:$L(X) I $E(X,%)?1P S X=$E(X,0,%-1)_$E(X,%+1,20),%=%-1
I X'?5N,(X'?9N) K X
Q
;
;
ZIPOUT ; output transform for ZIP - prints either ZIP or ZIP+4 (in 12345-1234)
; format.
;
; Input: Y as Fileman internal value
; Output: Y as external format (12345 or 12345-1234)
;
S Y=$E(Y,1,5)_$S($E(Y,6,9)]"":"-"_$E(Y,6,9),1:"")
Q
;
;
EOP() ; end of page check - return 1 to quit, 0 to continue
;
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
I $E(IOST,1,2)'="C-" Q 0 ; not to terminal
F Q:($Y>(IOSL-2)) W !
S DIR(0)="E"
D ^DIR
Q 'Y
;
;
NOW() ; return NOW in external format for print on reports
N X
S X=$$FMTE^XLFDT($$NOW^XLFDT())
Q $P($$UP^XLFSTR(X),":",1,2)
;
ID(NODE0) ;writes identifiers for file 910.2
Q:NODE0=""
N COLOR,TYPE,OWNER
S COLOR=$P(NODE0,"^",2)
I COLOR D
.S COLOR=$P($G(^ESP(910.7,COLOR,0)),"^")
E S COLOR=""
S TYPE=$P(NODE0,"^",4)
S TYPE=$S(TYPE=1:"VEHICLE",TYPE=2:"BICYCLE",TYPE=3:"WEAPON",TYPE=4:"PET",TYPE=5:"GOLF",1:"")
S OWNER=$P(NODE0,"^",3)
I OWNER D
.S OWNER=$P($G(^ESP(910,OWNER,0)),"^")
E S OWNER=""
W ?20," ",$J($E(COLOR,1,10),10)," ",$J($E(OWNER,1,30),30)," ",$J($E(TYPE,1,10),10)
Q
;
SUBTYPE(ESPS,ESPDTR) ;screen for field #.03/subfile #912.01/file #912
; input
; ESPS = what 2nd & 3rd piece of file #912.9 record
; ESPDTR = date/time (internal FM format) when offense report
; received
I $P(^(0),U,2,3)'=ESPS Q 0
I '$D(^(1)) Q 1
I ESPDTR>$P($G(^(1)),U,1) Q 0
Q 1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESPUTIL 2274 printed Nov 22, 2024@17:40:55 Page 2
ESPUTIL ;DALISC/CKA- CONVERTS UOR # TO DESIRED FORMAT & ZIP CODE TRANSFORMS;3/93
+1 ;;1.0;POLICE & SECURITY;**14,17,22**;Mar 31, 1994
EN ;Miscellaneous
UORN ;This is to get a UOR# fm 18 doesn't allow 1990 standard
+1 SET X=$$CONV^ESPUOR($PIECE(^ESP(912,D0,0),U,2))
+2 QUIT
XR ;This is to get a UOR# for UOR xref on DATE/TIME RECEIVED field
+1 SET ESPUOR=$$CONV^ESPUOR(X)
+2 QUIT
+3 ;This routine contains generic input and output transforms for the
+4 ;ZIP + extension fields which reside in DHCP
+5 ;
ZIPIN ; input transform for ZIP - massages user input and returns data
+1 ; in Fileman internal format (no '-'s)
+2 ;
+3 ; Input: X as user entered value
+4 ; Output: X as internal value of user input OR
+5 ; undefines if input from user was invalid
+6 ;
+7 NEW %
+8 IF X'?.N
FOR %=1:1:$LENGTH(X)
IF $EXTRACT(X,%)?1P
SET X=$EXTRACT(X,0,%-1)_$EXTRACT(X,%+1,20)
SET %=%-1
+9 IF X'?5N
IF (X'?9N)
KILL X
+10 QUIT
+11 ;
+12 ;
ZIPOUT ; output transform for ZIP - prints either ZIP or ZIP+4 (in 12345-1234)
+1 ; format.
+2 ;
+3 ; Input: Y as Fileman internal value
+4 ; Output: Y as external format (12345 or 12345-1234)
+5 ;
+6 SET Y=$EXTRACT(Y,1,5)_$SELECT($EXTRACT(Y,6,9)]"":"-"_$EXTRACT(Y,6,9),1:"")
+7 QUIT
+8 ;
+9 ;
EOP() ; end of page check - return 1 to quit, 0 to continue
+1 ;
+2 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+3 ; not to terminal
IF $EXTRACT(IOST,1,2)'="C-"
QUIT 0
+4 FOR
if ($Y>(IOSL-2))
QUIT
WRITE !
+5 SET DIR(0)="E"
+6 DO ^DIR
+7 QUIT 'Y
+8 ;
+9 ;
NOW() ; return NOW in external format for print on reports
+1 NEW X
+2 SET X=$$FMTE^XLFDT($$NOW^XLFDT())
+3 QUIT $PIECE($$UP^XLFSTR(X),":",1,2)
+4 ;
ID(NODE0) ;writes identifiers for file 910.2
+1 if NODE0=""
QUIT
+2 NEW COLOR,TYPE,OWNER
+3 SET COLOR=$PIECE(NODE0,"^",2)
+4 IF COLOR
Begin DoDot:1
+5 SET COLOR=$PIECE($GET(^ESP(910.7,COLOR,0)),"^")
End DoDot:1
+6 IF '$TEST
SET COLOR=""
+7 SET TYPE=$PIECE(NODE0,"^",4)
+8 SET TYPE=$SELECT(TYPE=1:"VEHICLE",TYPE=2:"BICYCLE",TYPE=3:"WEAPON",TYPE=4:"PET",TYPE=5:"GOLF",1:"")
+9 SET OWNER=$PIECE(NODE0,"^",3)
+10 IF OWNER
Begin DoDot:1
+11 SET OWNER=$PIECE($GET(^ESP(910,OWNER,0)),"^")
End DoDot:1
+12 IF '$TEST
SET OWNER=""
+13 WRITE ?20," ",$JUSTIFY($EXTRACT(COLOR,1,10),10)," ",$JUSTIFY($EXTRACT(OWNER,1,30),30)," ",$JUSTIFY($EXTRACT(TYPE,1,10),10)
+14 QUIT
+15 ;
SUBTYPE(ESPS,ESPDTR) ;screen for field #.03/subfile #912.01/file #912
+1 ; input
+2 ; ESPS = what 2nd & 3rd piece of file #912.9 record
+3 ; ESPDTR = date/time (internal FM format) when offense report
+4 ; received
+5 IF $PIECE(^(0),U,2,3)'=ESPS
QUIT 0
+6 IF '$DATA(^(1))
QUIT 1
+7 IF ESPDTR>$PIECE($GET(^(1)),U,1)
QUIT 0
+8 QUIT 1