PSN50612 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.612; 5 Sep 03
;;4.0; NATIONAL DRUG FILE;**80**; 30 Oct 98
;
DATA(PSNIEN,LIST) ;
;PSNIEN - IEN of entry in NATIONAL DRUG TRANSLATION file (#50.612).
;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,PSN50612,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.612,"","B","`"_PSNIEN,,,"") D
.I +PSNIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
.S ^TMP($J,LIST,0)=1
.D GETS^DIQ(50.612,+PSNIEN,"10;11","IE","PSN50612") S PSN(1)=0
.F S PSN(1)=$O(PSN50612(50.612,PSN(1))) Q:'PSN(1) D SETZRO
K ^TMP("DILIST",$J)
Q
SETZRO ;
S ^TMP($J,LIST,+PSN(1),10)=$G(PSN50612(50.612,PSN(1),10,"I"))
S ^TMP($J,LIST,+PSN(1),11)=$G(PSN50612(50.612,PSN(1),11,"I"))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSN50612 1034 printed Dec 13, 2024@02:22:28 Page 2
PSN50612 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.612; 5 Sep 03
+1 ;;4.0; NATIONAL DRUG FILE;**80**; 30 Oct 98
+2 ;
DATA(PSNIEN,LIST) ;
+1 ;PSNIEN - IEN of entry in NATIONAL DRUG TRANSLATION file (#50.612).
+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,PSN50612,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.612,"","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 DO GETS^DIQ(50.612,+PSNIEN,"10;11","IE","PSN50612")
SET PSN(1)=0
+13 FOR
SET PSN(1)=$ORDER(PSN50612(50.612,PSN(1)))
if 'PSN(1)
QUIT
DO SETZRO
End DoDot:1
+14 KILL ^TMP("DILIST",$JOB)
+15 QUIT
SETZRO ;
+1 SET ^TMP($JOB,LIST,+PSN(1),10)=$GET(PSN50612(50.612,PSN(1),10,"I"))
+2 SET ^TMP($JOB,LIST,+PSN(1),11)=$GET(PSN50612(50.612,PSN(1),11,"I"))
+3 QUIT