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

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

initial load of FOIAVistA 6/30/08 version

File size: 949 bytes
Line 
1VAUTL ;ALB/MRL - UTILITY FUNCTIONS; 13 APR 89
2 ;;5.3;Registration;;Aug 13, 1993
3 ;
4FA ;Format Address
5 ;REQUIRED VARIABLES = VADN-Address node; VAD(1)=Start with Piece;
6 ;VAD(2)=Build array starting where
7 ;RETURNS 'VADD' Array containing formated address information
8 ;OPTIONAL = VAEXT-Numeric number of characters to extract
9 ;
10 F I=VAD(1):1:VAD(1)+2 I $P(VADN,"^",I)]"" S VADD(VAD(2))=$P(VADN,"^",I),VAD(2)=VAD(2)+2
11 I VAD(2)=1 S VADD(1)="NO STREET",VAD(2)=VAD(2)+2
12 S J=$S($D(^DIC(5,+$P(VADN,"^",VAD(1)+4),0)):$P(^(0),"^",2),1:"NO STATE"),J(1)=$P(VADN,"^",VAD(1)+3) S:J(1)']"" J(1)="NO CITY" S J(2)=$P(VADN,"^",VAD(1)+5) S:J(2)']"" J(2)="NO ZIP"
13 S VADD(VAD(2))=J(1)_","_J_" "_J(2) K I,J,VAD,VADN I $S('$D(VAEXT):1,'VAEXT:1,1:0) Q
14 ;
15 S I=0 F I1=0:0 S I=$O(VADD(I)) Q:I'>0 S VADD(I)=$E(VADD(I),1,VAEXT)
16 K I,I1,VAEXT Q
17 ;
18PA ;Print Address
19 S I=0 F I1=0:0 S I=$O(VADD(I)) Q:I'>0 W:(I#2) ! S I2=$S((I#2):0,1:40) W ?I2,VADD(I)
20 K I,I1,I2,VADD Q
Note: See TracBrowser for help on using the repository browser.