DVBABADR ;ALB/RPM - CAPRI ADDRESS UTILITIES ; 06/11/2009
 ;;2.7;AMIE;**143**;Apr 10, 1995;Build 4
 ;
 
Q  ;NO DIRECT ENTRY
 ;
ZIP2CITY(RESULT,DVBZIP) ;return city/state list for a given zip code
 ;RPC: DVBAB ZIP2CITY
 ;
 
DVBCITY
 
DVBI
 
POSTALB^XIPUTIL(DVBZIP,.DVBCITY)
 
DVBI=0
 
RESULT(0)=DVBCITY_U_$G(DVBCITY("ERROR"))
 
F  S DVBI=$O(DVBCITY(DVBI)) Q:'DVBI  D
 
DVBCNTYP
 
DVBCNTYP=$$GETCNTYP($G(DVBCITY(DVBI,"COUNTY")),$G(DVBCITY(DVBI,"STATE POINTER")))
 . 
RESULT(DVBI)=$G(DVBCITY(DVBI,"CITY"))_U_$G(DVBCITY(DVBI,"COUNTY"))_U_DVBCNTYP_U_$G(DVBCITY(DVBI,"STATE"))_U_$G(DVBCITY(DVBI,"STATE POINTER"))
 
Q
 
;
GETCNTYP(DVBCNTY,DVBSTATE) ;
 
DVBRSLT
 
DVBRSLT=$$FIND1^DIC(5.01,","_DVBSTATE_",","X",DVBCNTY)
 
Q $S(DVBRSLT>0:DVBRSLT,1:"")