source: WorldVistAEHR/trunk/r/NATIONAL_DRUG_FILE-PSN/PSN50612.m@ 949

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

initial load of WorldVistAEHR

File size: 1011 bytes
Line 
1PSN50612 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.612; 5 Sep 03
2 ;;4.0; NATIONAL DRUG FILE;**80**; 30 Oct 98
3 ;
4DATA(PSNIEN,LIST) ;
5 ;PSNIEN - IEN of entry in NATIONAL DRUG TRANSLATION file (#50.612).
6 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
7 ; Field Number of the data piece being returned.
8 N DIERR,ZZERR,PSN50612,PSN,CNT
9 I $G(LIST)']"" Q
10 K ^TMP($J,LIST)
11 I +$G(PSNIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
12 I $G(PSNIEN)]"",+$G(PSNIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
13 I $G(PSNIEN)]"" N PSNIEN2 S PSNIEN2=$$FIND1^DIC(50.612,"","B","`"_PSNIEN,,,"") D
14 .I +PSNIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
15 .S ^TMP($J,LIST,0)=1
16 .D GETS^DIQ(50.612,+PSNIEN,"10;11","IE","PSN50612") S PSN(1)=0
17 .F S PSN(1)=$O(PSN50612(50.612,PSN(1))) Q:'PSN(1) D SETZRO
18 K ^TMP("DILIST",$J)
19 Q
20SETZRO ;
21 S ^TMP($J,LIST,+PSN(1),10)=$G(PSN50612(50.612,PSN(1),10,"I"))
22 S ^TMP($J,LIST,+PSN(1),11)=$G(PSN50612(50.612,PSN(1),11,"I"))
23 Q
Note: See TracBrowser for help on using the repository browser.