VistA-WorldVistAEHR/r/NATIONAL_DRUG_FILE-PSN/PSNBLD.m

19 lines
1.6 KiB
Mathematica

PSNBLD ;BIR/CCH&WRT-Builds temporary file for matches ; 10/13/98 13:37
;;4.0; NATIONAL DRUG FILE;; 30 Oct 98
S PSNFL=0,PSNFLB=0 S:'$D(^PSNTRAN("END")) ^PSNTRAN("END")=""
STWHN I $P(^PSNTRAN("END"),"^",1)']"" W !,"Automatic match by NDC Code process will begin",!!
I $P(^PSNTRAN("END"),"^",1)']"" R "Are you sure you want to continue ? N// ",ANS:DTIME S:'$T ANS="^" S:ANS']"" ANS="N" G:"^Nn"[$E(ANS) KILL
I $D(ANS),ANS?.E1C.E K ANS G PSNBLD
I $D(ANS),"?"[$E(ANS) D AUTO^PSNHELP1 G PSNBLD
I $D(ANS),"NnYy^"'[$E(ANS) G PSNBLD
S PSNFLB=1 I $D(ANS) D:"Yy"[$E(ANS) ^PSNNDC S:$D(XRT0) XRTN=$T(+0) D:$D(XRT0) T1^%ZOSV K ANS I $P(^PS(59.7,1,10),"^",3)=1 S NBR=0 D ^PSNCOMP,KILL Q
CCK I $P(^PS(59.7,1,10),"^",3)=1 D BEG
Q
BEG W !!,"Enter ""B"" to start at the beginning or press return",!,"to continue with next ==>> Drug: " R ANS:DTIME S:'$T ANS="^" G:ANS["^" KILL
I ANS?.E1C.E K ANS G BEG
I ANS="" S NBR=$P(^PSNTRAN("END"),"^",1) S:'$D(^PSNTRAN(NBR,"END")) ^PSNTRAN(NBR,"END")=NBR K:$P(^PSNTRAN(NBR,"END"),"^",3)="" ^PSNTRAN(NBR,"END") S:$D(^PSNTRAN(NBR,"END")) $P(^PSNTRAN(NBR,"END"),"^",1)="" K ANS D ^PSNCOMP,KILL Q
I "Bb"'[ANS D BLD1^PSNHELP G STWHN
S NBR=$P(^PSNTRAN("END"),"^",1) K:$P(^PSNTRAN(NBR,"END"),"^",3)="" ^PSNTRAN(NBR,"END") S:$D(^PSNTRAN(NBR,"END")) $P(^PSNTRAN(NBR,"END"),"^",1)="" S NBR=0 K ANS D ^PSNCOMP
KILL K PSNB,PSNDA,PSNSTDA,PSNUNDA,PSNDDA,ANS,DIC,II,MJL,JJ,NBR,PSNCLASS,PSNFL,PSNFLB,PSNFNM,PSNFORM,PSNNAM,PSNNAME,PSNNDA,PSNNDC,PSNNDF,PSNSP,PSNVAR,PSNSIZE,PSNTYPE,PSNSZ,PSNTRFL,PSNTYP,X,Y,KK,STOP,VAR,PSNDEA,PSNINACT
K PSND,PSNDFM,PSNVC,PSNVCL,PSNENT,PSNF,PSNM,PSNLOC,^TMP($J,"PSNND"),ASC,PSNRAN,PSNV,PSNWR,PSNX,PSNZ,WRT,BB,PSNP,END Q