PSN50626 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.626; 5 Sep 03
;;4.0; NATIONAL DRUG FILE;**80,94**; 30 Oct 98
;
DATA(PSNIEN,LIST) ;
;PSNIEN - IEN of entry in WARNING LABEL-SPANISH file (#50.626).
;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
; Field Number of the data piece being returned.
N DIERR,ZZERR,PSN50626,PSN,CNT
I $G(LIST)']"" Q
K ^TMP($J,LIST)
I +$G(PSNIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I $G(PSNIEN)]"",+$G(PSNIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I $G(PSNIEN)]"" N PSNIEN2 S PSNIEN2=$$FIND1^DIC(50.626,"","B","`"_PSNIEN,,,"") D
.I +PSNIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
.S ^TMP($J,LIST,0)=1
.S PSNIEN=PSNIEN2 I $O(^PS(50.626,+PSNIEN,1,0)),'$P(^PS(50.626,+PSNIEN,1,0),U,2) D SETHDR
.D GETS^DIQ(50.626,+PSNIEN,"**","IE","PSN50626") S PSN(1)=0
.F S PSN(1)=$O(PSN50626(50.626,PSN(1))) Q:'PSN(1) D
..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
..S ^TMP($J,LIST,+PSN(1),"WLT",0)=$S(+CNT>0:CNT,1:-1_"^"_"NO DATA FOUND")
K ^TMP("DILIST",$J)
Q
SETTXT ;
S ^TMP($J,LIST,+PSN(1),.01)=$G(PSN50626(50.626,PSN(1),.01,"I"))
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:"")
S ^TMP($J,LIST,+PSN(1),"WLT",+PSN(2),.01)=$G(PSN50626(50.626,PSN(1),1,PSN(2)))
Q
SETHDR ;
S $P(^PS(50.626,+PSNIEN,1,0),"^",2)="50.6261"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSN50626 1520 printed Nov 22, 2024@17:32:32 Page 2
PSN50626 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.626; 5 Sep 03
+1 ;;4.0; NATIONAL DRUG FILE;**80,94**; 30 Oct 98
+2 ;
DATA(PSNIEN,LIST) ;
+1 ;PSNIEN - IEN of entry in WARNING LABEL-SPANISH file (#50.626).
+2 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
+3 ; Field Number of the data piece being returned.
+4 NEW DIERR,ZZERR,PSN50626,PSN,CNT
+5 IF $GET(LIST)']""
QUIT
+6 KILL ^TMP($JOB,LIST)
+7 IF +$GET(PSNIEN)'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+8 IF $GET(PSNIEN)]""
IF +$GET(PSNIEN)'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+9 IF $GET(PSNIEN)]""
NEW PSNIEN2
SET PSNIEN2=$$FIND1^DIC(50.626,"","B","`"_PSNIEN,,,"")
Begin DoDot:1
+10 IF +PSNIEN2'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+11 SET ^TMP($JOB,LIST,0)=1
+12 SET PSNIEN=PSNIEN2
IF $ORDER(^PS(50.626,+PSNIEN,1,0))
IF '$PIECE(^PS(50.626,+PSNIEN,1,0),U,2)
DO SETHDR
+13 DO GETS^DIQ(50.626,+PSNIEN,"**","IE","PSN50626")
SET PSN(1)=0
+14 FOR
SET PSN(1)=$ORDER(PSN50626(50.626,PSN(1)))
if 'PSN(1)
QUIT
Begin DoDot:2
+15 SET (CNT,PSN(2))=0
FOR
SET PSN(2)=$ORDER(PSN50626(50.626,PSN(1),1,PSN(2)))
if 'PSN(2)
QUIT
DO SETTXT
SET CNT=CNT+1
+16 SET ^TMP($JOB,LIST,+PSN(1),"WLT",0)=$SELECT(+CNT>0:CNT,1:-1_"^"_"NO DATA FOUND")
End DoDot:2
End DoDot:1
+17 KILL ^TMP("DILIST",$JOB)
+18 QUIT
SETTXT ;
+1 SET ^TMP($JOB,LIST,+PSN(1),.01)=$GET(PSN50626(50.626,PSN(1),.01,"I"))
+2 SET ^TMP($JOB,LIST,+PSN(1),2)=$SELECT($GET(PSN50626(50.626,PSN(1),2,"I"))]"":$GET(PSN50626(50.626,PSN(1),2,"I"))_"^"_$GET(PSN50626(50.626,PSN(1),2,"E")),1:"")
+3 SET ^TMP($JOB,LIST,+PSN(1),"WLT",+PSN(2),.01)=$GET(PSN50626(50.626,PSN(1),1,PSN(2)))
+4 QUIT
SETHDR ;
+1 SET $PIECE(^PS(50.626,+PSNIEN,1,0),"^",2)="50.6261"
+2 QUIT