VistA-FOIAVistA/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSDENT.m

9 lines
456 B
Mathematica

PSSDENT ;BIR/WRT-Put ID number on "ND" node ; 09/01/98 7:08;
;;1.0;PHARMACY DATA MANAGEMENT;**15**;9/30/97
D START K IEN,ID,PSSDA,PSSDA1
Q
START F IEN=0:0 S IEN=$O(^PSDRUG(IEN)) Q:'IEN I $D(^PSDRUG(IEN,"ND")),$P(^PSDRUG(IEN,"ND"),"^",2)]"" D IDENT
Q
IDENT S PSSDA=$P(^PSDRUG(IEN,"ND"),"^"),PSSDA1=$P(^PSDRUG(IEN,"ND"),"^",3),DA=PSSDA,K=PSSDA1,X=$$PROD2^PSNAPIS(DA,K) I X]"" S ID=$P(X,"^",2),$P(^PSDRUG(IEN,"ND"),"^",10)=ID,^PSDRUG("AQ1",ID,IEN)=""
Q