source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFADDR.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 840 bytes
Line 
1VAFADDR ;ALB/MIR - ADDRESS UTILITIES (INPUT AND OUTPUT TRANSFORM) ; 25 JAN 93
2 ;;5.3;Registration;;Aug 13, 1993
3 ;
4 ; This routine contains generic input and output transforms for the
5 ; ZIP+extension fields which reside in DHCP
6 ;
7ZIPIN ; input transform for ZIP - massages user input and returns data
8 ; in FileMan internal format (no '-'s)
9 ;
10 ; Input: X as user entered value
11 ; Output: X as internal value of user input OR
12 ; undefined if input from user was invalid
13 ;
14 N %
15 I X'?.N F %=1:1:$L(X) I $E(X,%)?1P S X=$E(X,0,%-1)_$E(X,%+1,20),%=%-1
16 I X'?5N,(X'?9N) K X
17 Q
18 ;
19 ;
20ZIPOUT ; output transform for ZIP - prints either ZIP or ZIP+4 (in 12345-1234)
21 ; format.
22 ;
23 ; Input: Y as FileMan internal value
24 ; Output: Y as external format (12345 or 12345-1234)
25 ;
26 S Y=$E(Y,1,5)_$S($E(Y,6,9)]"":"-"_$E(Y,6,9),1:"")
27 Q
Note: See TracBrowser for help on using the repository browser.