source: FOIAVistA/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNPPIO.m@ 1674

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1PSNPPIO ;BIR/JLC - return PMI in TMP ; 21 Apr 2004 9:32 AM
2 ;;4.0; NATIONAL DRUG FILE;**68,84**; 30 Oct 98
3 ;
4 ; Reference to ^PS(59.7 supported by IA #2613
5 ; Reference to ^PSDRUG supported by IA #221
6 ; Reference to ^PS(55 supported by IA #2191
7 ;
8EN(PSNDRUG,PSNMSG) ;
9 ;
10 ; entry point from Outpatient Pharmacy Labels
11 ; Calling method: S PSNFLAG=$$EN^PSNPPIO(PSNDRUG)
12 ;
13 ; Input: PSNDRUG = IFN from the DRUG file (50) ** REQUIRED **
14 ;
15 ; Output: PSNFLAG = 0 if no PMI returned
16 ; 1 if PMI returned in ^TMP($J,"PSNPMI"
17 ; MSG = message text for no PMI information
18 ;
19 N PSNFLAG,PSNPN,PSNGCN,A1,A2,PSNFILE1,PSNFILE2,PSNEMAP,PMID,PSNPL,I
20 K ^TMP($J,"PSNPMI")
21 S PSNFLAG=1,PSNPN=$P($G(^PSDRUG(PSNDRUG,"ND")),"^",3)
22 I 'PSNPN S PSNMSG="This drug is not matched to the National Drug File; therefore, a Medication Information Sheet cannot be printed." Q 0
23 S PSNGCN=$P($G(^PSNDF(50.68,PSNPN,1)),"^",5)
24 I 'PSNGCN S PSNMSG="This drug is not linked to a Medication Information Sheet." Q 0
25 S A1=$G(^PS(59.7,1,10)),A2=$$GET1^DIQ(55,$G(DFN)_",",106.1,"I"),PSNPL=$P(A1,"^",7),PSNFILE1=$S(A2=2:50.624,PSNPL=2:50.624,1:50.623),PSNFILE2=PSNFILE1-.002
26 S PSNEMAP=$O(^PS(PSNFILE1,"B",PSNGCN,0)) I 'PSNEMAP S PSNMSG="This drug is not linked to a Medication Information Sheet." Q 0
27 S PSNGCN=+$P($G(^PS(PSNFILE1,PSNEMAP,0)),"^",2) I '$D(^PS(PSNFILE2,PSNGCN)) S PSNMSG="This drug is not linked to a Medication Information Sheet." Q 0
28 M ^TMP($J,"PSNPMI")=^PS(PSNFILE2,PSNGCN)
29 S PMID=$P(A1,"^",8) F I=1:1:$L(PMID,",") K ^TMP($J,"PSNPMI",$P(PMID,",",I))
30 Q 1
Note: See TracBrowser for help on using the repository browser.