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

PSSSYN.m

Go to the documentation of this file.
PSSSYN ;BIR/WRT-ADD SYNONYMS FROM 50 TO ORDERABLE ITEM FILE ; 09/02/97 8:56
 ;;1.0;PHARMACY DATA MANAGEMENT;;9/30/97
 D LOOP,DEX
 Q
LOOP F NUM=0:0 S NUM=$O(^PSDRUG(NUM)) Q:'NUM  I $D(^PSDRUG(NUM,2)) S POI=$P(^PSDRUG(NUM,2),"^",1) I POI]"",$D(^PS(50.7,POI,0)) D LOOP1
 Q
LOOP1 I $D(^PSDRUG(NUM,1,0)) F NUMB=0:0 S NUMB=$O(^PSDRUG(NUM,1,NUMB)) Q:'NUMB  S IUSE=$P(^PSDRUG(NUM,1,NUMB,0),"^",3) I IUSE=0!(IUSE="") S SYNO=$P(^PSDRUG(NUM,1,NUMB,0),"^",1) D CHEK
 Q
CHEK I '$D(^PS(50.7,"C",SYNO,POI)) D ADD
 Q
ADD S DA(1)=POI,DIC="^PS(50.7,"_POI_",2,",X=SYNO,DIC(0)="L",DIC("P")=$P(^DD(50.7,2,0),"^",2),DLAYGO=50.72 D ^DIC
 Q
DEX K ^PS(50.7,"C") F IEN=0:0 S IEN=$O(^PS(50.7,IEN)) Q:'IEN  F IEN1=0:0 S IEN1=$O(^PS(50.7,IEN,2,IEN1)) Q:'IEN1  S SYN=$P(^PS(50.7,IEN,2,IEN1,0),"^",1),^PS(50.7,"C",SYN,IEN,IEN1)=""
 Q