source: WorldVistAEHR/trunk/r/NATIONAL_DRUG_FILE-PSN/PSN50627.m@ 1686

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1PSN50627 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.627; 5 Sep 03
2 ;;4.0; NATIONAL DRUG FILE;**80**; 30 Oct 98
3 ;
4DATA(PSNIEN,PSNFT,LIST) ;
5 ;PSNIEN - IEN of entry in WARNING LABEL MAP file (#50.627).
6 ;PSNFT - Free Text name in VA DRUG CLASS file (#50.627).
7 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
8 ; Field Number of the data piece being returned.
9 N DIERR,ZZERR,PSN50627,PSN,CNT
10 I $G(LIST)']"" Q
11 K ^TMP($J,LIST)
12 I +$G(PSNIEN)'>0,($G(PSNFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
13 I $G(PSNIEN)]"",+$G(PSNIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
14 I $G(PSNIEN)]"" N PSNIEN2 S PSNIEN2=$$FIND1^DIC(50.627,"","B","`"_PSNIEN,,,"") D
15 .I +PSNIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
16 .S ^TMP($J,LIST,0)=1
17 .D GETS^DIQ(50.627,+PSNIEN,".01;1;2","IE","PSN50627") S PSN(1)=0
18 .F S PSN(1)=$O(PSN50627(50.627,PSN(1))) Q:'PSN(1) D SETZRO
19 I $G(PSNIEN)="",$G(PSNFT)]"" D
20 .I PSNFT["??" D LOOP Q
21 .D FIND^DIC(50.627,,"@;.01;1","QP",PSNFT,,"B",,,"")
22 .I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
23 .I +^TMP("DILIST",$J,0)>0 S ^TMP($J,LIST,0)=+^TMP("DILIST",$J,0) N PSNXX S PSNXX=0 F S PSNXX=$O(^TMP("DILIST",$J,PSNXX)) Q:'PSNXX D
24 ..S PSNIEN=+^TMP("DILIST",$J,PSNXX,0) K PSN50627 D GETS^DIQ(50.627,+PSNIEN,".01;1;2","IE","PSN50627") S PSN(1)=0
25 ..F S PSN(1)=$O(PSN50627(50.627,PSN(1))) Q:'PSN(1) D SETZRO
26 K ^TMP("DILIST",$J)
27 Q
28SETZRO ;
29 S ^TMP($J,LIST,+PSN(1),.01)=$G(PSN50627(50.627,PSN(1),.01,"I"))
30 S ^TMP($J,LIST,"B",$G(PSN50627(50.627,PSN(1),.01,"I")),+PSN(1))=""
31 S ^TMP($J,LIST,+PSN(1),1)=$G(PSN50627(50.627,PSN(1),1,"I"))
32 S ^TMP($J,LIST,+PSN(1),2)=$G(PSN50627(50.627,PSN(1),2,"I"))
33 Q
34LOOP ;
35 N PSNIEN,CNT S CNT=0
36 S PSNIEN=0 F S PSNIEN=$O(^PS(50.627,PSNIEN)) Q:'PSNIEN D
37 .K PSN50627 D GETS^DIQ(50.627,+PSNIEN,".01;1;2","IE","PSN50627") S PSN(1)=0 D
38 ..F S PSN(1)=$O(PSN50627(50.627,PSN(1))) Q:'PSN(1) D SETZRO S CNT=CNT+1
39 S ^TMP($J,LIST,0)=$S(+CNT>0:CNT,1:"-1^NO DATA FOUND")
40 Q
Note: See TracBrowser for help on using the repository browser.