source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSS50P4.m@ 1474

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

initial load of WorldVistAEHR

File size: 2.0 KB
RevLine 
[613]1PSS50P4 ;BIR/LDT - API FOR INFORMATION FROM FILE 50.4; 5 Sep 03
2 ;;1.0;PHARMACY DATA MANAGEMENT;**85**;9/30/97
3 ;
4ALL(PSSIEN,PSSFT,LIST) ;
5 ;PSSIEN - IEN of entry in 50.4.
6 ;PSSFT - Free Text name in 50.4.
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 ;Returns NAME field (#.01) and CONCENTRATION UNITS field (#1) of DRUG ELECTROLYTES file (#50.4).
10 N DIERR,ZZERR,PSS50P4,SCR,PSS
11 I $G(LIST)']"" Q
12 K ^TMP($J,LIST)
13 I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
14 I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
15 I +$G(PSSIEN)>0 N PSSIEN2 S PSSIEN2=$$FIND1^DIC(50.4,"","A","`"_PSSIEN,,,"") D
16 .I +PSSIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
17 .S ^TMP($J,LIST,0)=1
18 .D GETS^DIQ(50.4,+PSSIEN2,".01;1","IE","PSS50P4") S PSS(1)=0
19 .F S PSS(1)=$O(PSS50P4(50.4,PSS(1))) Q:'PSS(1) D SETALL
20 I +$G(PSSIEN)'>0,$G(PSSFT)]"" D
21 .I PSSFT["??" D LOOP Q
22 .D FIND^DIC(50.4,,"@;.01;","QP",PSSFT,,"B",,,"")
23 .I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
24 .I +^TMP("DILIST",$J,0)>0 S ^TMP($J,LIST,0)=+^TMP("DILIST",$J,0) N PSSXLP S PSSXLP=0 F S PSSXLP=$O(^TMP("DILIST",$J,PSSXLP)) Q:'PSSXLP D
25 ..S PSSIEN=+^TMP("DILIST",$J,PSSXLP,0) K PSS50P4 D GETS^DIQ(50.4,+PSSIEN,".01;1","IE","PSS50P4") S PSS(1)=0
26 ..F S PSS(1)=$O(PSS50P4(50.4,PSS(1))) Q:'PSS(1) D SETALL
27 K ^TMP("DILIST",$J)
28 Q
29 ;
30SETALL ;
31 S ^TMP($J,LIST,+PSS(1),.01)=$G(PSS50P4(50.4,PSS(1),.01,"I"))
32 S ^TMP($J,LIST,"B",$G(PSS50P4(50.4,PSS(1),.01,"I")),+PSS(1))=""
33 S ^TMP($J,LIST,+PSS(1),1)=$S($G(PSS50P4(50.4,PSS(1),1,"I"))="":"",1:PSS50P4(50.4,PSS(1),1,"I")_"^"_PSS50P4(50.4,PSS(1),1,"E"))
34 Q
35 ;
36LOOP ;
37 N CNT,PSSIEN S CNT=0
38 S PSSIEN=0 F S PSSIEN=$O(^PS(50.4,PSSIEN)) Q:'PSSIEN K PSS50P4 D GETS^DIQ(50.4,+PSSIEN,".01;1","IE","PSS50P4") S PSS(1)=0 D
39 .F S PSS(1)=$O(PSS50P4(50.4,PSS(1))) Q:'PSS(1) D SETALL S CNT=CNT+1
40 S ^TMP($J,LIST,0)=$S(CNT>0:CNT,1:"-1^NO DATA FOUND")
41 Q
Note: See TracBrowser for help on using the repository browser.