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

ACHSWVEN.m

Go to the documentation of this file.
ACHSWVEN ;IHS/OIT/LMH - BUILD CHS VENDOR DATA ; 
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**14,15**;JUN 11,2001
 ;WEBFRS DATA EXTRACT ORIGINAL ROUTINE FR  KEVIN ROGERS
 ;ACHS*3.1*14 IHS/OIT/LMH Brought into ACHS namespace Patch
 ;ACHS*3.1*15 2.11.2009 IHS/OIT/FCJ ADDED TEST FOR ZIP+4 AND MAILING CITY AND STATE DEFINNED
 ; 
 Q:'ACHSVDFN  D
 .Q:$D(^AUTTVNDR(ACHSVDFN,0))'=1  S ACHS0=^(0)
 .S ACHSNAME=$P(ACHS0,"^")
 .;
 .;------------------- Node 11 -----------------------
 .;
 .S ACHSEIN="",ACHSEINS="",ACHSMPH="",ACHSRPH="",ACHSBPH="",ACHSPHON=""
 .S ACHSMFAX=""
 .I $D(^AUTTVNDR(ACHSVDFN,11))=1 S ACHS11=^(11) D
 ..S ACHSEIN=$P(ACHS11,"^"),ACHSEINS=$P(ACHS11,"^",2)
 ..S ACHSMPH=$P(ACHS11,"^",9),ACHSMFAX=$P(ACHS11,"^",14)
 .;
 .;-------------------Node 13 --------------------------
 .;
 .S (ACHSMAST,ACHSMAC,ACHSMSTA,ACHSMZIP,ACHSMPH)=""
 .S (ACHSBAST,ACHSBAC,ACHSBSTA,ACHSBZIP,ACHSBPH,ACHSBFAX)=""
 .I $D(^AUTTVNDR(ACHSVDFN,13))=1 S ACHS13=^(13) D
 ..S ACHSMAST=$P(ACHS13,"^"),ACHSMAC=$P(ACHS13,"^",2)
 ..S ACHSMSTA=$P(ACHS13,"^",3),ACHSMZIP=$P(ACHS13,"^",4)
 ..I +ACHSMSTA I $D(^DIC(5,+ACHSMSTA,0))=1 S ACHSMSTA=$P(^(0),"^",2)
 ..S ACHSBAST=$P(ACHS13,"^",6),ACHSBAC=$P(ACHS13,"^",7)
 ..S ACHSBSTA=$P(ACHS13,"^",8),ACHSBZIP=$P(ACHS13,"^",9)
 ..I +ACHSBSTA I $D(^DIC(5,+ACHSBSTA,0))=1 S ACHSBSTA=$P(^(0),"^",2)
 .;
 .;-----------------------Node 14 -------------------------
 .;
 .S (ACHSRAST,ACHSRAC,ACHSRSTA,ACHSRZIP,ACHSRPH,ACHSVFAX)=""
 .I $D(^AUTTVNDR(ACHSVDFN,14))=1 S ACHS14=^(14) D
 ..S ACHSRAST=$P(ACHS14,"^"),ACHSRAC=$P(ACHS14,"^",3)
 ..S ACHSRSTA=$P(ACHS14,"^",4),ACHSRZIP=$P(ACHS14,"^",5)
 ..I +ACHSRSTA I $D(^DIC(5,+ACHSRSTA,0))=1 S ACHSRSTA=$P(^(0),"^",2)
 ..S ACHSRPH=$P(ACHS14,"^",7),ACHSBPH=$P(ACHS14,"^",8)
 ..S ACHSBFAX=$P(ACHS14,"^",9),ACHSVFAX=$P(ACHS14,"^",10)
 .;
 .;--------------------- Build Data String --------------------
 .;
 .;VENDOR_ID^NAME^EIN^EIN_SUFFIX^MSTREET^MCITY^MSTATE^MZIP^
 .;MPHONE^MFAX^BSTREET^BCITY^BSTATE^BZIP^BPHONE^BFAX^RSTREET^RCITY^
 .;RSTATE^RZIP^RPHONE^RFAX"
 .;
 .S ACHSDATA=ASUFAC_ACHSVDFN_"^"_ACHSNAME_"^"_ACHSEIN_"^"_ACHSEINS_"^"
 .S ACHSDATA=ACHSDATA_ACHSMAST_"^"_ACHSMAC_"^"_ACHSMSTA_"^"_ACHSMZIP_"^"_ACHSMPH_"^"_ACHSMFAX_"^"
 .S ACHSDATA=ACHSDATA_ACHSBAST_"^"_ACHSBAC_"^"_ACHSBSTA_"^"_ACHSBZIP_"^"_ACHSBPH_"^"_ACHSBFAX_"^"
 .S ACHSDATA=ACHSDATA_ACHSRAST_"^"_ACHSRAC_"^"_ACHSRSTA_"^"_ACHSRZIP_"^"_ACHSRPH_"^"_ACHSVFAX
 .S:(ACHSMAC="")!(ACHSMSTA="") ACHSERR(7)=1   ;ACHS*3.1*15 2.11.2009 IHS/OIT/FCJ
 .S X=$TR(ACHSMZIP,"-, ,:,,,","") S:X'?9N ACHSERR(8)=1  ;ACHS*3.1*15 2.11.2009 IHS/OIT/FCJ
 .;
 K ACHSX,ACHS0,ACHSNAME,ACHSEIN,ACHSEINS
 K ACHSMAST,ACHSMAC,ACHSMSTA,ACHSMZIP,ACHSMPH,ACHSMFAX
 K ACHSBAST,ACHSBAC,ACHSBSTA,ACHSBZIP,ACHSBPH,ACHSBFAX
 K ACHSRAST,ACHSRAC,ACHSRSTA,ACHSRZIP,ACHSRPH,ACHSRFAX
 K ACHSPHON,ACHS11,ACHS14