1 | PSN50626 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.626; 5 Sep 03
|
---|
2 | ;;4.0; NATIONAL DRUG FILE;**80,94**; 30 Oct 98
|
---|
3 | ;
|
---|
4 | DATA(PSNIEN,LIST) ;
|
---|
5 | ;PSNIEN - IEN of entry in WARNING LABEL-SPANISH file (#50.626).
|
---|
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,PSN50626,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.626,"","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 | .S PSNIEN=PSNIEN2 I $O(^PS(50.626,+PSNIEN,1,0)),'$P(^PS(50.626,+PSNIEN,1,0),U,2) D SETHDR
|
---|
17 | .D GETS^DIQ(50.626,+PSNIEN,"**","IE","PSN50626") S PSN(1)=0
|
---|
18 | .F S PSN(1)=$O(PSN50626(50.626,PSN(1))) Q:'PSN(1) D
|
---|
19 | ..S (CNT,PSN(2))=0 F S PSN(2)=$O(PSN50626(50.626,PSN(1),1,PSN(2))) Q:'PSN(2) D SETTXT S CNT=CNT+1
|
---|
20 | ..S ^TMP($J,LIST,+PSN(1),"WLT",0)=$S(+CNT>0:CNT,1:-1_"^"_"NO DATA FOUND")
|
---|
21 | K ^TMP("DILIST",$J)
|
---|
22 | Q
|
---|
23 | SETTXT ;
|
---|
24 | S ^TMP($J,LIST,+PSN(1),.01)=$G(PSN50626(50.626,PSN(1),.01,"I"))
|
---|
25 | S ^TMP($J,LIST,+PSN(1),2)=$S($G(PSN50626(50.626,PSN(1),2,"I"))]"":$G(PSN50626(50.626,PSN(1),2,"I"))_"^"_$G(PSN50626(50.626,PSN(1),2,"E")),1:"")
|
---|
26 | S ^TMP($J,LIST,+PSN(1),"WLT",+PSN(2),.01)=$G(PSN50626(50.626,PSN(1),1,PSN(2)))
|
---|
27 | Q
|
---|
28 | SETHDR ;
|
---|
29 | S $P(^PS(50.626,+PSNIEN,1,0),"^",2)="50.6261"
|
---|
30 | Q
|
---|