[613] | 1 | PSNPST ;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
|
---|
| 10 | BUILD 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
|
---|
| 12 | START 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
|
---|
| 14 | BRANCH1 S FORMI=$P($G(^PSNDF(50.68,LINK,5)),"^") I FORMI]"" S $P(^PSDRUG(IFN,"ND"),"^",11)=FORMI
|
---|
| 15 | Q
|
---|
| 16 | BRANCH2 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
|
---|
| 18 | ENTER 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
|
---|
| 20 | KILL K ^TMP($J,"PSNFI"),LINK,NDT,IFN,FORMI,NFR,ENTRY,NFLAG,NFLAG1,PSSORDIT,ZZZ,IEN
|
---|
| 21 | Q
|
---|
| 22 | BRANCH3 U IO W !,"Converting PHARMACY ORDERABLE ITEM file (#50.7)" D BRANCH4
|
---|
| 23 | Q
|
---|
| 24 | BRANCH4 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
|
---|
| 26 | NF1 D:NFLAG=0 NF3
|
---|
| 27 | S:$P(^PSDRUG(ZZZ,0),"^",9)'="" NFLAG1=1
|
---|
| 28 | Q
|
---|
| 29 | NF2 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
|
---|
| 32 | NF3 S:$P(^PSDRUG(ZZZ,0),"^",9)="" NFLAG=1
|
---|
| 33 | Q
|
---|
| 34 | FIX 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
|
---|