Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: VAUTL

VAUTL.m

Go to the documentation of this file.
  1. VAUTL ;ALB/MRL - UTILITY FUNCTIONS; 13 APR 89
  1. ;;5.3;Registration;;Aug 13, 1993
  1. ;
  1. FA ;Format Address
  1. ;REQUIRED VARIABLES = VADN-Address node; VAD(1)=Start with Piece;
  1. ;VAD(2)=Build array starting where
  1. ;RETURNS 'VADD' Array containing formated address information
  1. ;OPTIONAL = VAEXT-Numeric number of characters to extract
  1. ;
  1. F I=VAD(1):1:VAD(1)+2 I $P(VADN,"^",I)]"" S VADD(VAD(2))=$P(VADN,"^",I),VAD(2)=VAD(2)+2
  1. I VAD(2)=1 S VADD(1)="NO STREET",VAD(2)=VAD(2)+2
  1. 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"
  1. S VADD(VAD(2))=J(1)_","_J_" "_J(2) K I,J,VAD,VADN I $S('$D(VAEXT):1,'VAEXT:1,1:0) Q
  1. ;
  1. S I=0 F I1=0:0 S I=$O(VADD(I)) Q:I'>0 S VADD(I)=$E(VADD(I),1,VAEXT)
  1. K I,I1,VAEXT Q
  1. ;
  1. PA ;Print Address
  1. 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)
  1. K I,I1,I2,VADD Q