source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXNDC.m@ 703

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1ECXNDC ;ALB/JAP BIR/CML - Lookup Routine for NDC's ; 6/7/05 1:52pm
2 ;;3.0;DSS EXTRACTS;**10,11,24,84**;Dec 22, 1997
3EN ;entry point from option
4 N F5068,QFLG
5 S F5068=0 I $T(PSNAPIS+1^PSNAPIS)[";;4.0;" S F5068=1
6 W @IOF
7 W !!,"Pharmacy Feeder Keys for DSS are built in the following manner."
8 I 'F5068 D NDF3 Q:QFLG
9 I F5068 D NDF4 Q:QFLG
10 W @IOF
11 W !,"This option will allow lookups on the local DRUG file (#50) using "
12 W !,"NDCs from DSS Pharmacy Feeder Keys that have been rejected because"
13 I 'F5068 D
14 .W !,"the first seven characters are zeros. (Ex. ""0000000051079014120"")"
15 I F5068 D
16 .W !,"the first five characters are zeros in a 17 character Feeder Key."
17 .W !,"(Ex. ""00000051079014120"")"
18 .W !,"OR"
19 .W !,"the first seven characters are zeros in a 19 character Feeder Key."
20 .W !,"(Ex. ""0000000051079014120"")"
21 W !!,"This would occur when a pharmacy item has not been matched to the"
22 W !,"the National Drug File (NDF)."
23 W !!,"Enter the NDC (last twelve characters) from a rejected feeder key"
24 W !,"to display information from the local DRUG file for any drug which"
25 W !,"has that NDC."
26 D ASK
27 K %,%H,%Y,DRG,DRGNM,ECD,LN,POP,X,Y,DUOUT,DTOUT
28 Q
29ASK ;select ndc for lookup
30 K DUOUT,DTOUT
31 W !!!,"Enter 12 numeric characters at the prompt or <cr> to exit.",!
32 S DIC=50,DIC(0)="QEA",D="NDC",DIC("A")="Select NDC: "
33 ;Use pharmacy encapsulation API for MIX^DIC1 dbia 4551
34 D MIX^PSSDI(50,"ECX",.DIC,D,,)
35 Q:Y<0 Q:($D(DUOUT)!$D(DTOUT))
36 S DRG=+Y
37 ;Use pharmacy encapsulation API for EN^DIQ1 dbia 4451
38 S DIQ="ECXDIQ",DIQ(0)="E" D EN^PSSDI(50,"DSS",DIC,".01;2;31;14.5;16",DRG,.DIQ)
39 K LN S DRGNM=ECXDIQ(50,DRG,.01,"E"),$P(LN,"-",$L(DRGNM)+1)=""
40 W !!,DRGNM,!,LN
41 W !,"NDC: ",ECXDIQ(50,DRG,31,"E"),?40,"VA Classification: ",ECXDIQ(50,DRG,2,"E")
42 W !,"Dispense Unit: ",ECXDIQ(50,DRG,14.5,"E"),?40,"Price per Dispense Unit: ",ECXDIQ(50,DRG,16,"E")
43 K ECXDIQ,X,Y,DIC,DIQ,DRG,ECXDIQ,D
44 G ASK
45 ;
46NDF3 ;before ndf v4
47 S QFLG=0
48 W !!,"Your site is running NATIONAL DRUG FILE (NDF) v3.18, so"
49 W !,"PHA Feeder Keys are composed of 19 numeric characters."
50 W !!?5,"Ex. ""0016006000003073531"" where characters:"
51 W !!?5,"1-4 (0016) = pointer to the NATIONAL DRUG file (#50.6)"
52 W !?5,"5-7 (006) = pointer to VA PRODUCT NAME subfile (#50.68)"
53 W !?5," of the NATIONAL DRUG file (#50.6)"
54 W !?5,"8-19 (000003073531) = NDC from the local DRUG file (#50)"
55 I $E(IOST)="C" D
56 .S SS=22-$Y F JJ=1:1:SS W !
57 .S DIR(0)="E" W ! D ^DIR K DIR S:'Y QFLG=1
58 Q
59 ;
60NDF4 ;after ndf v4
61 S QFLG=0
62 W !!,"Your site is running NATIONAL DRUG FILE (NDF) v4.0."
63 W !,"If Pharmacy data is dated after September 30, 1998,"
64 W !,"then PHA Feeder Keys are composed of 17 numeric characters."
65 W !!?5,"Ex. ""12006000003073531"" where characters:"
66 W !?5,"1-5 (12006) = pointer to VA PRODUCT NAME file (#50.68)"
67 W !?5,"6-17 (000003073531) = NDC from the local DRUG file (#50)"
68 W !!,"If Pharmacy data is dated prior to October 1, 1998,"
69 W !,"then PHA Feeder Keys are composed of 19 numeric characters."
70 W !!?5,"Ex. ""0016006000003073531"" where characters:"
71 W !!?5,"1-4 (0016) = pointer to the NATIONAL DRUG file (#50.6)"
72 W !?5,"5-7 (006) = pointer to VA PRODUCT NAME subfile (#50.68)"
73 W !?5," of the NATIONAL DRUG file (#50.6)"
74 W !?5,"8-19 (000003073531) = NDC from the local DRUG file (#50)"
75 I $E(IOST)="C" D
76 .S SS=22-$Y F JJ=1:1:SS W !
77 .S DIR(0)="E" W ! D ^DIR K DIR S:'Y QFLG=1
78 Q
Note: See TracBrowser for help on using the repository browser.