source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESPUTIL.m@ 702

Last change on this file since 702 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1ESPUTIL ;DALISC/CKA- CONVERTS UOR # TO DESIRED FORMAT & ZIP CODE TRANSFORMS;3/93
2 ;;1.0;POLICE & SECURITY;**14,17,22**;Mar 31, 1994
3EN ;Miscellaneous
4UORN ;This is to get a UOR# fm 18 doesn't allow 1990 standard
5 S X=$$CONV^ESPUOR($P(^ESP(912,D0,0),U,2))
6 Q
7XR ;This is to get a UOR# for UOR xref on DATE/TIME RECEIVED field
8 S ESPUOR=$$CONV^ESPUOR(X)
9 Q
10 ;This routine contains generic input and output transforms for the
11 ;ZIP + extension fields which reside in DHCP
12 ;
13ZIPIN ; input transform for ZIP - massages user input and returns data
14 ; in Fileman internal format (no '-'s)
15 ;
16 ; Input: X as user entered value
17 ; Output: X as internal value of user input OR
18 ; undefines if input from user was invalid
19 ;
20 N %
21 I X'?.N F %=1:1:$L(X) I $E(X,%)?1P S X=$E(X,0,%-1)_$E(X,%+1,20),%=%-1
22 I X'?5N,(X'?9N) K X
23 Q
24 ;
25 ;
26ZIPOUT ; output transform for ZIP - prints either ZIP or ZIP+4 (in 12345-1234)
27 ; format.
28 ;
29 ; Input: Y as Fileman internal value
30 ; Output: Y as external format (12345 or 12345-1234)
31 ;
32 S Y=$E(Y,1,5)_$S($E(Y,6,9)]"":"-"_$E(Y,6,9),1:"")
33 Q
34 ;
35 ;
36EOP() ; end of page check - return 1 to quit, 0 to continue
37 ;
38 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
39 I $E(IOST,1,2)'="C-" Q 0 ; not to terminal
40 F Q:($Y>(IOSL-2)) W !
41 S DIR(0)="E"
42 D ^DIR
43 Q 'Y
44 ;
45 ;
46NOW() ; return NOW in external format for print on reports
47 N X
48 S X=$$FMTE^XLFDT($$NOW^XLFDT())
49 Q $P($$UP^XLFSTR(X),":",1,2)
50 ;
51ID(NODE0) ;writes identifiers for file 910.2
52 Q:NODE0=""
53 N COLOR,TYPE,OWNER
54 S COLOR=$P(NODE0,"^",2)
55 I COLOR D
56 .S COLOR=$P($G(^ESP(910.7,COLOR,0)),"^")
57 E S COLOR=""
58 S TYPE=$P(NODE0,"^",4)
59 S TYPE=$S(TYPE=1:"VEHICLE",TYPE=2:"BICYCLE",TYPE=3:"WEAPON",TYPE=4:"PET",TYPE=5:"GOLF",1:"")
60 S OWNER=$P(NODE0,"^",3)
61 I OWNER D
62 .S OWNER=$P($G(^ESP(910,OWNER,0)),"^")
63 E S OWNER=""
64 W ?20," ",$J($E(COLOR,1,10),10)," ",$J($E(OWNER,1,30),30)," ",$J($E(TYPE,1,10),10)
65 Q
66 ;
67SUBTYPE(ESPS,ESPDTR) ;screen for field #.03/subfile #912.01/file #912
68 ; input
69 ; ESPS = what 2nd & 3rd piece of file #912.9 record
70 ; ESPDTR = date/time (internal FM format) when offense report
71 ; received
72 I $P(^(0),U,2,3)'=ESPS Q 0
73 I '$D(^(1)) Q 1
74 I ESPDTR>$P($G(^(1)),U,1) Q 0
75 Q 1
Note: See TracBrowser for help on using the repository browser.