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
;
N DVBCITY
N DVBI
D POSTALB^XIPUTIL(DVBZIP,.DVBCITY)
S DVBI=0
S RESULT(0)=DVBCITY_U_$G(DVBCITY("ERROR"))
F S DVBI=$O(DVBCITY(DVBI)) Q:'DVBI D
. N DVBCNTYP
. S DVBCNTYP=$$GETCNTYP($G(DVBCITY(DVBI,"COUNTY")),$G(DVBCITY(DVBI,"STATE POINTER")))
. S 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) ;
N DVBRSLT
S DVBRSLT=$$FIND1^DIC(5.01,","_DVBSTATE_",","X",DVBCNTY)
Q $S(DVBRSLT>0:DVBRSLT,1:"")
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBABADR 773 printed Dec 13, 2024@01:40:48 Page 2
DVBABADR ;ALB/RPM - CAPRI ADDRESS UTILITIES ; 06/11/2009
+1 ;;2.7;AMIE;**143**;Apr 10, 1995;Build 4
+2 ;
+3 ;NO DIRECT ENTRY
QUIT
+4 ;
ZIP2CITY(RESULT,DVBZIP) ;return city/state list for a given zip code
+1 ;RPC: DVBAB ZIP2CITY
+2 ;
+3 NEW DVBCITY
+4 NEW DVBI
+5 DO POSTALB^XIPUTIL(DVBZIP,.DVBCITY)
+6 SET DVBI=0
+7 SET RESULT(0)=DVBCITY_U_$GET(DVBCITY("ERROR"))
+8 FOR
SET DVBI=$ORDER(DVBCITY(DVBI))
if 'DVBI
QUIT
Begin DoDot:1
+9 NEW DVBCNTYP
+10 SET DVBCNTYP=$$GETCNTYP($GET(DVBCITY(DVBI,"COUNTY")),$GET(DVBCITY(DVBI,"STATE POINTER")))
+11 SET RESULT(DVBI)=$GET(DVBCITY(DVBI,"CITY"))_U_$GET(DVBCITY(DVBI,"COUNTY"))_U_DVBCNTYP_U_$GET(DVBCITY(DVBI,"STATE"))_U_$GET(DVBCITY(DVBI,"STATE POINTER"))
End DoDot:1
+12 QUIT
+13 ;
GETCNTYP(DVBCNTY,DVBSTATE) ;
+1 NEW DVBRSLT
+2 SET DVBRSLT=$$FIND1^DIC(5.01,","_DVBSTATE_",","X",DVBCNTY)
+3 QUIT $SELECT(DVBRSLT>0:DVBRSLT,1:"")