ACRFNDF ;IHS/OIRM/DSD/THL,AEF - NDF CONVERSION TO ARMS STANDARD ITEM FILE; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;ROUTINE TO CONVERT NATIONAL DRUG FILE TO ARMS STANDARD ITEM FILE
EN D EN1
EXIT K ACRQUIT
K ACRVANAM,ACRV,ACRVANAM,ACRTNAM,ACRADMIN,ACRVPN
Q
EN1 S ACR="^PSNDF(""NDC"")"
S ACRX="PSNDF(""NDC"""
F S ACR=$Q(@ACR) Q:ACR=""!(ACR'[ACRX) D
.S (ACRVANAM,ACRV,ACRVANAM,ACRTNAM,ACRADMIN,ACRVPN)=""
.S DA=$P($P(ACR,",",9),")")
.S ACRNDC=$P(ACR,",",2)
.F ACRI=1:1:6 S DA(ACRI)=$P(ACR,",",ACRI+2)
.I $D(^PSNDF(DA(1),2,DA(2),3,DA(3),4,DA(4),5,DA(5),6,DA(6),7,DA,0)) S ACRTNAM=$P(^(0),U,3),ACRVDA=$P(^(0),U,2),ACRADMIN=$P(^(0),U,5),ACRVPN=$P(^(0),U,4)
.I ACRVDA,$D(^PS(55.95,ACRVDA,0)) S ACRV=$P(^(0),U)
.I $D(^PSNDF(DA(1),0)) S ACRVANAM=$P(^(0),U)
.I $D(^PSNDF(DA(1),5,ACRVPN,0)) S ACRVPN=$P(^(0),U)
.W !!,ACRNDC
.W ?20,"VA GENERIC NAME: ",ACRVANAM
.W !?20,"VA PRODUCT NAME: ",ACRVPN
.W !?20,"TRADE NAME.....: ",ACRTNAM
.W !?20,"ADMINISTRATION.: ",ACRADMIN
.W !?20,"VENDOR.........: ",ACRV
Q
ACRFNDF ;IHS/OIRM/DSD/THL,AEF - NDF CONVERSION TO ARMS STANDARD ITEM FILE; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;ROUTINE TO CONVERT NATIONAL DRUG FILE TO ARMS STANDARD ITEM FILE
EN DO EN1
EXIT KILL ACRQUIT
+1 KILL ACRVANAM,ACRV,ACRVANAM,ACRTNAM,ACRADMIN,ACRVPN
+2 QUIT
EN1 SET ACR="^PSNDF(""NDC"")"
+1 SET ACRX="PSNDF(""NDC"""
+2 FOR
SET ACR=$QUERY(@ACR)
IF ACR=""!(ACR'[ACRX)
QUIT
Begin DoDot:1
+3 SET (ACRVANAM,ACRV,ACRVANAM,ACRTNAM,ACRADMIN,ACRVPN)=""
+4 SET DA=$PIECE($PIECE(ACR,",",9),")")
+5 SET ACRNDC=$PIECE(ACR,",",2)
+6 FOR ACRI=1:1:6
SET DA(ACRI)=$PIECE(ACR,",",ACRI+2)
+7 IF $DATA(^PSNDF(DA(1),2,DA(2),3,DA(3),4,DA(4),5,DA(5),6,DA(6),7,DA,0))
SET ACRTNAM=$PIECE(^(0),U,3)
SET ACRVDA=$PIECE(^(0),U,2)
SET ACRADMIN=$PIECE(^(0),U,5)
SET ACRVPN=$PIECE(^(0),U,4)
+8 IF ACRVDA
IF $DATA(^PS(55.95,ACRVDA,0))
SET ACRV=$PIECE(^(0),U)
+9 IF $DATA(^PSNDF(DA(1),0))
SET ACRVANAM=$PIECE(^(0),U)
+10 IF $DATA(^PSNDF(DA(1),5,ACRVPN,0))
SET ACRVPN=$PIECE(^(0),U)
+11 WRITE !!,ACRNDC
+12 WRITE ?20,"VA GENERIC NAME: ",ACRVANAM
+13 WRITE !?20,"VA PRODUCT NAME: ",ACRVPN
+14 WRITE !?20,"TRADE NAME.....: ",ACRTNAM
+15 WRITE !?20,"ADMINISTRATION.: ",ACRADMIN
+16 WRITE !?20,"VENDOR.........: ",ACRV
End DoDot:1
+17 QUIT