source: FOIAVistA/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNPST.m@ 1446

Last change on this file since 1446 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1PSNPST ;BIR/WRT-POST INSTALL routine ; 02/03/00 7:52
2 ;;4.0; NATIONAL DRUG FILE;**22**; 30 Oct 98
3 ;
4 ;Reference to ^PSDRUG supported by DBIA #2352
5 ;Reference to ^PS(51.7 supported by DBIA #2935
6 ;Reference to ^PS(50.7 supported by DBIA #2180
7 ;
8 K ^TMP($J,"PSNFI") D FIX,BUILD,START,BRANCH3,KILL
9 Q
10BUILD F NDT=0:0 S NDT=$O(^PS(51.7,NDT)) Q:'NDT S TEXT=^PS(51.7,NDT,2,1,0),^TMP($J,"PSNFI",TEXT)=NDT
11 Q
12START U IO W !,"Converting DRUG file (#50)" F IFN=0:0 S IFN=$O(^PSDRUG(IFN)) Q:'IFN U IO W:'(IFN#100) "." S LINK=$P($G(^PSDRUG(IFN,"ND")),"^",3) I LINK D BRANCH1,BRANCH2
13 Q
14BRANCH1 S FORMI=$P($G(^PSNDF(50.68,LINK,5)),"^") I FORMI]"" S $P(^PSDRUG(IFN,"ND"),"^",11)=FORMI
15 Q
16BRANCH2 S NFR=$P($G(^PSNDF(50.68,LINK,6,1,0)),"^") I NFR]"",$D(^TMP($J,"PSNFI",NFR)) S ENTRY=$P(^TMP($J,"PSNFI",NFR),"^") D ENTER
17 Q
18ENTER I '$D(^PSDRUG(IFN,9,0)) S DA(1)=IFN,DIC="^PSDRUG("_IFN_",9,",X=ENTRY,DIC(0)="L",DIC("P")=$P(^DD(50,37,0),"^",2),DLAYGO=50.037 D FILE^DICN
19 Q
20KILL K ^TMP($J,"PSNFI"),LINK,NDT,IFN,FORMI,NFR,ENTRY,NFLAG,NFLAG1,PSSORDIT,ZZZ,IEN
21 Q
22BRANCH3 U IO W !,"Converting PHARMACY ORDERABLE ITEM file (#50.7)" D BRANCH4
23 Q
24BRANCH4 F PSSORDIT=0:0 S PSSORDIT=$O(^PS(50.7,PSSORDIT)) Q:'PSSORDIT U IO W:'(PSSORDIT#100) "." I $D(^PSDRUG("ASP",PSSORDIT)) S NFLAG=0,NFLAG1=0 F ZZZ=0:0 S ZZZ=$O(^PSDRUG("ASP",PSSORDIT,ZZZ)) Q:'ZZZ D NF1,NF2
25 Q
26NF1 D:NFLAG=0 NF3
27 S:$P(^PSDRUG(ZZZ,0),"^",9)'="" NFLAG1=1
28 Q
29NF2 I NFLAG=0 S $P(^PS(50.7,PSSORDIT,0),"^",12)=1
30 I NFLAG=1 S $P(^PS(50.7,PSSORDIT,0),"^",12)=""
31 Q
32NF3 S:$P(^PSDRUG(ZZZ,0),"^",9)="" NFLAG=1
33 Q
34FIX F IEN=0:0 S IEN=$O(^PSNDF(50.68,IEN)) Q:'IEN I '$D(^PSNDF(50.68,IEN,5)) S ^PSNDF(50.68,IEN,5)=0
35 Q
Note: See TracBrowser for help on using the repository browser.