PSS52P7 ;BIR/LDT - API FOR INFORMATION FROM FILE 52.7; 5 Sep 03
;;1.0;PHARMACY DATA MANAGEMENT;**85**;9/30/97
;
ZERO(PSSIEN,PSSFT,PSSFL,LIST) ;
;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
;PSSFT - Free Text name in IV SOLUTIONS file (#52.7).
;PSSFL - Inactive flag - 0 or "" - All entries
; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
;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.
;Returns PRINT NAME field (#.01), PRINT NAME {2} field (#.02), GENERIC DRUG field (#1), VOLUME field (#2),
;AVERAGE DRUG COST PER UNIT field (#7), INACTIVATION DATE field (#8), PHARMACY ORDERABLE ITEM field (#9),
;USED IN IV FLUID ORDER ENTRY field (#17), ELECTROLYTES multiple (#4), ELECTROLYTES field (#.01),
;CONCENTRATION (#1) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,SCR,PSS,CNT2
I $G(LIST)']"" Q
K ^TMP($J,LIST)
I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
S SCR("S")=""
I +$G(PSSFL)>0 N ND D SETSCRN
I +$G(PSSIEN)>0 N PSSIEN2 S PSSIEN2=$$FIND1^DIC(52.7,"","A","`"_PSSIEN,,SCR("S"),"") D
.I +PSSIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
.S ^TMP($J,LIST,0)=1
.D GETS^DIQ(52.7,+PSSIEN,".01;1;2;.02;7;8;9;17","IE","PSS52P7") S PSS(1)=0
.F S PSS(1)=$O(PSS52P7(52.7,PSS(1))) Q:'PSS(1) D SETZERO^PSS52P7A,GETS^DIQ(52.7,+PSSIEN,"4*","IE","PSS52P7") S (PSS(2),CNT2)=0
.F S PSS(2)=$O(PSS52P7(52.702,PSS(2))) Q:'PSS(2) D SETLTS^PSS52P7A S CNT2=CNT2+1
.S ^TMP($J,LIST,+PSSIEN,"ELYTES",0)=$S(CNT2>0:CNT2,1:"-1^NO DATA FOUND")
I +$G(PSSIEN)'>0,$G(PSSFT)]"" D
.I PSSFT["??" D LOOP^PSS52P7A(1) Q
.D FIND^DIC(52.7,,"@;.01;2","QP",PSSFT,,"B",SCR("S"),,"")
.I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
.I +^TMP("DILIST",$J,0)>0 S ^TMP($J,LIST,0)=+^TMP("DILIST",$J,0) N PSSXX S PSSXX=0 F S PSSXX=$O(^TMP("DILIST",$J,PSSXX)) Q:'PSSXX D
..S PSSIEN=+^TMP("DILIST",$J,PSSXX,0) K PSS52P7 D GETS^DIQ(52.7,+PSSIEN,".01;1;2;.02;7;8;9;17","IE","PSS52P7") S PSS(1)=0
..F S PSS(1)=$O(PSS52P7(52.7,PSS(1))) Q:'PSS(1) D SETZERO^PSS52P7A K PSS52P7 D GETS^DIQ(52.7,+PSSIEN,"4*","IE","PSS52P7") S (PSS(2),CNT2)=0
..F S PSS(2)=$O(PSS52P7(52.702,PSS(2))) Q:'PSS(2) D SETLTS^PSS52P7A S CNT2=CNT2+1
..S ^TMP($J,LIST,+PSSIEN,"ELYTES",0)=$S(CNT2>0:CNT2,1:"-1^NO DATA FOUND")
K ^TMP("DILIST",$J)
Q
;
DRGIEN(PSS50,PSSFL,LIST) ;
;PSS50 - IEN of entry in DRUG file (#50).
;PSSFL - Inactive flag - 0 or "" - All entries
; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
;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.
;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,SCR
I $G(LIST)']"" Q
K ^TMP($J,LIST)
I +$G(PSS50)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
S SCR("S")=""
I +$G(PSSFL)>0 N ND D SETSCRN
I +$G(PSS50)>0 D FIND^DIC(52.7,,"@;.01;2","QPX",PSS50,,"AC",SCR("S"),,"PSS52P7")
I +PSS52P7("DILIST",0)=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I +PSS52P7("DILIST",0)>0 S ^TMP($J,LIST,0)=+PSS52P7("DILIST",0) N PSSXX S PSSXX=0 F S PSSXX=$O(PSS52P7("DILIST",PSSXX)) Q:'PSSXX D
.S ^TMP($J,LIST,+PSS52P7("DILIST",PSSXX,0),.01)=$P($G(PSS52P7("DILIST",PSSXX,0)),"^",2)
.S ^TMP($J,LIST,"AC",$P($G(PSS52P7("DILIST",PSSXX,0)),"^",2),+PSS52P7("DILIST",PSSXX,0))=""
.S ^TMP($J,LIST,+PSS52P7("DILIST",PSSXX,0),2)=$P($G(PSS52P7("DILIST",PSSXX,0)),"^",3)
Q
;
INACTDT(PSSIEN) ;
;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
;Returns INACTIVATION DATE field (#8) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,PSS
I +$G(PSSIEN)'>0 Q ""
I +$G(PSSIEN)>0 D GETS^DIQ(52.7,+PSSIEN,"8","I","PSS52P7") S PSS(1)=0 D
.I '$D(PSS52P7) S PSSINACT="" Q
.F S PSS(1)=$O(PSS52P7(52.7,PSS(1))) Q:'PSS(1) S PSSINACT=$G(PSS52P7(52.7,PSS(1),8,"I"))
Q PSSINACT
;
LOOKUP(PSSFT,LIST) ;
;PSSFT - Free Text name in IV SOLUTIONS file (#52.7).
;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.
;Returns PRINT NAME field (#.01), VOLUME field (#2), and PRINT NAME {2} field (#.02) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,PSS
I $G(LIST)']"" Q
K ^TMP($J,LIST)
I $G(PSSFT)']"" S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I PSSFT["??" D LOOP^PSS52P7A(2) Q
D FIND^DIC(52.7,,"@;.01;","QP",PSSFT,,"B",,,"")
I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I +^TMP("DILIST",$J,0)>0 S ^TMP($J,LIST,0)=+^TMP("DILIST",$J,0) N PSSXX S PSSXX=0 F S PSSXX=$O(^TMP("DILIST",$J,PSSXX)) Q:'PSSXX D
.S PSSIEN=+^TMP("DILIST",$J,PSSXX,0) K PSS52P7 D GETS^DIQ(52.7,+PSSIEN,".01;2;.02","IE","PSS52P7") S PSS(1)=0
.F S PSS(1)=$O(PSS52P7(52.7,PSS(1))) Q:'PSS(1) D SETLOOK^PSS52P7A
K ^TMP("DILIST",$J)
Q
;
POICHK(PSSIEN) ;
;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
;Returns PHARMACY ORDERABLE ITEM field (#9) PHARMACY ORDERABLE ITEM of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,PSS
I +$G(PSSIEN)'>0 Q 0
I +$G(PSSIEN)>0 D GETS^DIQ(52.7,+PSSIEN,"9","I","PSS52P7") S PSS(1)=0 D
.I '$D(PSS52P7) S PSSOI=0
.F S PSS(1)=$O(PSS52P7(52.7,PSS(1))) Q:'PSS(1) S PSSOI=+$G(PSS52P7(52.7,PSS(1),9,"I"))
Q PSSOI
;
POI(PSSOI,PSSFL,LIST) ;
;PSSOI - IEN of entry in the PHARMACY ORDERABLE ITEM file (#50.7) [required].
;PSSFL - Inactive flag - 0 or "" - All entries
; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
;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.
;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSS52P7,SCR
I $G(LIST)']"" Q
K ^TMP($J,LIST)
I +$G(PSSOI)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
S SCR("S")=""
I +$G(PSSFL)>0 N ND D SETSCRN
D FIND^DIC(52.7,,"@;.01;2","QPX",PSSOI,,"AOI",SCR("S"),,"")
I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
I +^TMP("DILIST",$J,0)>0 S ^TMP($J,LIST,0)=+^TMP("DILIST",$J,0) N PSSXX S PSSXX=0 F S PSSXX=$O(^TMP("DILIST",$J,PSSXX)) Q:'PSSXX D
.S PSSIEN=+^TMP("DILIST",$J,PSSXX,0)
.S ^TMP($J,LIST,+PSSIEN,.01)=$P($G(^TMP("DILIST",$J,PSSXX,0)),"^",2)
.S ^TMP($J,LIST,"AOI",$P($G(^TMP("DILIST",$J,PSSXX,0)),"^",2),+PSSIEN)=""
.S ^TMP($J,LIST,+PSSIEN,2)=$P($G(^TMP("DILIST",$J,PSSXX,0)),"^",3)
K ^TMP("DILIST",$J)
Q
;
ACTSOL(PSSFL,LIST) ;
;PSSFL - Inactive flag - 0 or "" - All entries
; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
;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.
;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
N DIERR,ZZERR,PSSIEN,CNT,SCR
I $G(LIST)']"" Q
K ^TMP($J,LIST)
S SCR("S")=""
I +$G(PSSFL)>0 N ND D SETSCRN
;Naked reference below refers to ^PS(52.7,+Y,"I")
I +$G(PSSFL)'>0 S SCR("S")="S ND=$P($G(^(""I"")),U) I ND=""""!(ND>DT)"
N PSSIEN S (CNT,PSSIEN)=0 F S PSSIEN=$O(^PS(52.7,PSSIEN)) Q:'PSSIEN D
.D FIND^DIC(52.7,,"@;.01;2","QP","`"_PSSIEN,,"B",SCR("S"),,"")
.I ^TMP("DILIST",$J,0)>0 S CNT=CNT+1 D
..S ^TMP($J,LIST,+PSSIEN,.01)=$P($G(^TMP("DILIST",$J,1,0)),"^",2)
..S ^TMP($J,LIST,"B",$P($G(^TMP("DILIST",$J,1,0)),"^",2),+PSSIEN)=""
..S ^TMP($J,LIST,+PSSIEN,2)=$P($G(^TMP("DILIST",$J,1,0)),"^",3)
S ^TMP($J,LIST,0)=$S(CNT>0:CNT,1:-1_"^"_"NO DATA FOUND")
K ^TMP("DILIST",$J)
Q
;
SETSCRN ;Set Screen for inactive Solutions
;Naked reference below refers to ^PS(52.7,+Y,"I")
S SCR("S")="S ND=$P($G(^(""I"")),U) I ND=""""!(ND>PSSFL)"
Q
PSS52P7 ;BIR/LDT - API FOR INFORMATION FROM FILE 52.7; 5 Sep 03
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**85**;9/30/97
+2 ;
ZERO(PSSIEN,PSSFT,PSSFL,LIST) ;
+1 ;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
+2 ;PSSFT - Free Text name in IV SOLUTIONS file (#52.7).
+3 ;PSSFL - Inactive flag - 0 or "" - All entries
+4 ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
+5 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
+6 ; Field Number of the data piece being returned.
+7 ;Returns PRINT NAME field (#.01), PRINT NAME {2} field (#.02), GENERIC DRUG field (#1), VOLUME field (#2),
+8 ;AVERAGE DRUG COST PER UNIT field (#7), INACTIVATION DATE field (#8), PHARMACY ORDERABLE ITEM field (#9),
+9 ;USED IN IV FLUID ORDER ENTRY field (#17), ELECTROLYTES multiple (#4), ELECTROLYTES field (#.01),
+10 ;CONCENTRATION (#1) of IV SOLUTIONS file (#52.7).
+11 NEW DIERR,ZZERR,PSS52P7,SCR,PSS,CNT2
+12 IF $GET(LIST)']""
QUIT
+13 KILL ^TMP($JOB,LIST)
+14 IF +$GET(PSSIEN)'>0
IF ($GET(PSSFT)']"")
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+15 IF $GET(PSSIEN)]""
IF +$GET(PSSIEN)'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+16 SET SCR("S")=""
+17 IF +$GET(PSSFL)>0
NEW ND
DO SETSCRN
+18 IF +$GET(PSSIEN)>0
NEW PSSIEN2
SET PSSIEN2=$$FIND1^DIC(52.7,"","A","`"_PSSIEN,,SCR("S"),"")
Begin DoDot:1
+19 IF +PSSIEN2'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+20 SET ^TMP($JOB,LIST,0)=1
+21 DO GETS^DIQ(52.7,+PSSIEN,".01;1;2;.02;7;8;9;17","IE","PSS52P7")
SET PSS(1)=0
+22 FOR
SET PSS(1)=$ORDER(PSS52P7(52.7,PSS(1)))
IF 'PSS(1)
QUIT
DO SETZERO^PSS52P7A
DO GETS^DIQ(52.7,+PSSIEN,"4*","IE","PSS52P7")
SET (PSS(2),CNT2)=0
+23 FOR
SET PSS(2)=$ORDER(PSS52P7(52.702,PSS(2)))
IF 'PSS(2)
QUIT
DO SETLTS^PSS52P7A
SET CNT2=CNT2+1
+24 SET ^TMP($JOB,LIST,+PSSIEN,"ELYTES",0)=$SELECT(CNT2>0:CNT2,1:"-1^NO DATA FOUND")
End DoDot:1
+25 IF +$GET(PSSIEN)'>0
IF $GET(PSSFT)]""
Begin DoDot:1
+26 IF PSSFT["??"
DO LOOP^PSS52P7A(1)
QUIT
+27 DO FIND^DIC(52.7,,"@;.01;2","QP",PSSFT,,"B",SCR("S"),,"")
+28 IF +$GET(^TMP("DILIST",$JOB,0))=0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+29 IF +^TMP("DILIST",$JOB,0)>0
SET ^TMP($JOB,LIST,0)=+^TMP("DILIST",$JOB,0)
NEW PSSXX
SET PSSXX=0
FOR
SET PSSXX=$ORDER(^TMP("DILIST",$JOB,PSSXX))
IF 'PSSXX
QUIT
Begin DoDot:2
+30 SET PSSIEN=+^TMP("DILIST",$JOB,PSSXX,0)
KILL PSS52P7
DO GETS^DIQ(52.7,+PSSIEN,".01;1;2;.02;7;8;9;17","IE","PSS52P7")
SET PSS(1)=0
+31 FOR
SET PSS(1)=$ORDER(PSS52P7(52.7,PSS(1)))
IF 'PSS(1)
QUIT
DO SETZERO^PSS52P7A
KILL PSS52P7
DO GETS^DIQ(52.7,+PSSIEN,"4*","IE","PSS52P7")
SET (PSS(2),CNT2)=0
+32 FOR
SET PSS(2)=$ORDER(PSS52P7(52.702,PSS(2)))
IF 'PSS(2)
QUIT
DO SETLTS^PSS52P7A
SET CNT2=CNT2+1
+33 SET ^TMP($JOB,LIST,+PSSIEN,"ELYTES",0)=$SELECT(CNT2>0:CNT2,1:"-1^NO DATA FOUND")
End DoDot:2
End DoDot:1
+34 KILL ^TMP("DILIST",$JOB)
+35 QUIT
+36 ;
DRGIEN(PSS50,PSSFL,LIST) ;
+1 ;PSS50 - IEN of entry in DRUG file (#50).
+2 ;PSSFL - Inactive flag - 0 or "" - All entries
+3 ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
+4 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
+5 ; Field Number of the data piece being returned.
+6 ;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
+7 NEW DIERR,ZZERR,PSS52P7,SCR
+8 IF $GET(LIST)']""
QUIT
+9 KILL ^TMP($JOB,LIST)
+10 IF +$GET(PSS50)'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+11 SET SCR("S")=""
+12 IF +$GET(PSSFL)>0
NEW ND
DO SETSCRN
+13 IF +$GET(PSS50)>0
DO FIND^DIC(52.7,,"@;.01;2","QPX",PSS50,,"AC",SCR("S"),,"PSS52P7")
+14 IF +PSS52P7("DILIST",0)=0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+15 IF +PSS52P7("DILIST",0)>0
SET ^TMP($JOB,LIST,0)=+PSS52P7("DILIST",0)
NEW PSSXX
SET PSSXX=0
FOR
SET PSSXX=$ORDER(PSS52P7("DILIST",PSSXX))
IF 'PSSXX
QUIT
Begin DoDot:1
+16 SET ^TMP($JOB,LIST,+PSS52P7("DILIST",PSSXX,0),.01)=$PIECE($GET(PSS52P7("DILIST",PSSXX,0)),"^",2)
+17 SET ^TMP($JOB,LIST,"AC",$PIECE($GET(PSS52P7("DILIST",PSSXX,0)),"^",2),+PSS52P7("DILIST",PSSXX,0))=""
+18 SET ^TMP($JOB,LIST,+PSS52P7("DILIST",PSSXX,0),2)=$PIECE($GET(PSS52P7("DILIST",PSSXX,0)),"^",3)
End DoDot:1
+19 QUIT
+20 ;
INACTDT(PSSIEN) ;
+1 ;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
+2 ;Returns INACTIVATION DATE field (#8) of IV SOLUTIONS file (#52.7).
+3 NEW DIERR,ZZERR,PSS52P7,PSS
+4 IF +$GET(PSSIEN)'>0
QUIT ""
+5 IF +$GET(PSSIEN)>0
DO GETS^DIQ(52.7,+PSSIEN,"8","I","PSS52P7")
SET PSS(1)=0
Begin DoDot:1
+6 IF '$DATA(PSS52P7)
SET PSSINACT=""
QUIT
+7 FOR
SET PSS(1)=$ORDER(PSS52P7(52.7,PSS(1)))
IF 'PSS(1)
QUIT
SET PSSINACT=$GET(PSS52P7(52.7,PSS(1),8,"I"))
End DoDot:1
+8 QUIT PSSINACT
+9 ;
LOOKUP(PSSFT,LIST) ;
+1 ;PSSFT - Free Text name in IV SOLUTIONS file (#52.7).
+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 ;Returns PRINT NAME field (#.01), VOLUME field (#2), and PRINT NAME {2} field (#.02) of IV SOLUTIONS file (#52.7).
+5 NEW DIERR,ZZERR,PSS52P7,PSS
+6 IF $GET(LIST)']""
QUIT
+7 KILL ^TMP($JOB,LIST)
+8 IF $GET(PSSFT)']""
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+9 IF PSSFT["??"
DO LOOP^PSS52P7A(2)
QUIT
+10 DO FIND^DIC(52.7,,"@;.01;","QP",PSSFT,,"B",,,"")
+11 IF +$GET(^TMP("DILIST",$JOB,0))=0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+12 IF +^TMP("DILIST",$JOB,0)>0
SET ^TMP($JOB,LIST,0)=+^TMP("DILIST",$JOB,0)
NEW PSSXX
SET PSSXX=0
FOR
SET PSSXX=$ORDER(^TMP("DILIST",$JOB,PSSXX))
IF 'PSSXX
QUIT
Begin DoDot:1
+13 SET PSSIEN=+^TMP("DILIST",$JOB,PSSXX,0)
KILL PSS52P7
DO GETS^DIQ(52.7,+PSSIEN,".01;2;.02","IE","PSS52P7")
SET PSS(1)=0
+14 FOR
SET PSS(1)=$ORDER(PSS52P7(52.7,PSS(1)))
IF 'PSS(1)
QUIT
DO SETLOOK^PSS52P7A
End DoDot:1
+15 KILL ^TMP("DILIST",$JOB)
+16 QUIT
+17 ;
POICHK(PSSIEN) ;
+1 ;PSSIEN - IEN of entry in IV SOLUTIONS file (#52.7).
+2 ;Returns PHARMACY ORDERABLE ITEM field (#9) PHARMACY ORDERABLE ITEM of IV SOLUTIONS file (#52.7).
+3 NEW DIERR,ZZERR,PSS52P7,PSS
+4 IF +$GET(PSSIEN)'>0
QUIT 0
+5 IF +$GET(PSSIEN)>0
DO GETS^DIQ(52.7,+PSSIEN,"9","I","PSS52P7")
SET PSS(1)=0
Begin DoDot:1
+6 IF '$DATA(PSS52P7)
SET PSSOI=0
+7 FOR
SET PSS(1)=$ORDER(PSS52P7(52.7,PSS(1)))
IF 'PSS(1)
QUIT
SET PSSOI=+$GET(PSS52P7(52.7,PSS(1),9,"I"))
End DoDot:1
+8 QUIT PSSOI
+9 ;
POI(PSSOI,PSSFL,LIST) ;
+1 ;PSSOI - IEN of entry in the PHARMACY ORDERABLE ITEM file (#50.7) [required].
+2 ;PSSFL - Inactive flag - 0 or "" - All entries
+3 ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
+4 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
+5 ; Field Number of the data piece being returned.
+6 ;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
+7 NEW DIERR,ZZERR,PSS52P7,SCR
+8 IF $GET(LIST)']""
QUIT
+9 KILL ^TMP($JOB,LIST)
+10 IF +$GET(PSSOI)'>0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+11 SET SCR("S")=""
+12 IF +$GET(PSSFL)>0
NEW ND
DO SETSCRN
+13 DO FIND^DIC(52.7,,"@;.01;2","QPX",PSSOI,,"AOI",SCR("S"),,"")
+14 IF +$GET(^TMP("DILIST",$JOB,0))=0
SET ^TMP($JOB,LIST,0)=-1_"^"_"NO DATA FOUND"
QUIT
+15 IF +^TMP("DILIST",$JOB,0)>0
SET ^TMP($JOB,LIST,0)=+^TMP("DILIST",$JOB,0)
NEW PSSXX
SET PSSXX=0
FOR
SET PSSXX=$ORDER(^TMP("DILIST",$JOB,PSSXX))
IF 'PSSXX
QUIT
Begin DoDot:1
+16 SET PSSIEN=+^TMP("DILIST",$JOB,PSSXX,0)
+17 SET ^TMP($JOB,LIST,+PSSIEN,.01)=$PIECE($GET(^TMP("DILIST",$JOB,PSSXX,0)),"^",2)
+18 SET ^TMP($JOB,LIST,"AOI",$PIECE($GET(^TMP("DILIST",$JOB,PSSXX,0)),"^",2),+PSSIEN)=""
+19 SET ^TMP($JOB,LIST,+PSSIEN,2)=$PIECE($GET(^TMP("DILIST",$JOB,PSSXX,0)),"^",3)
End DoDot:1
+20 KILL ^TMP("DILIST",$JOB)
+21 QUIT
+22 ;
ACTSOL(PSSFL,LIST) ;
+1 ;PSSFL - Inactive flag - 0 or "" - All entries
+2 ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
+3 ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
+4 ; Field Number of the data piece being returned.
+5 ;Returns PRINT NAME field (#.01) and VOLUME field (#2) of IV SOLUTIONS file (#52.7).
+6 NEW DIERR,ZZERR,PSSIEN,CNT,SCR
+7 IF $GET(LIST)']""
QUIT
+8 KILL ^TMP($JOB,LIST)
+9 SET SCR("S")=""
+10 IF +$GET(PSSFL)>0
NEW ND
DO SETSCRN
+11 ;Naked reference below refers to ^PS(52.7,+Y,"I")
+12 IF +$GET(PSSFL)'>0
SET SCR("S")="S ND=$P($G(^(""I"")),U) I ND=""""!(ND>DT)"
+13 NEW PSSIEN
SET (CNT,PSSIEN)=0
FOR
SET PSSIEN=$ORDER(^PS(52.7,PSSIEN))
IF 'PSSIEN
QUIT
Begin DoDot:1
+14 DO FIND^DIC(52.7,,"@;.01;2","QP","`"_PSSIEN,,"B",SCR("S"),,"")
+15 IF ^TMP("DILIST",$JOB,0)>0
SET CNT=CNT+1
Begin DoDot:2
+16 SET ^TMP($JOB,LIST,+PSSIEN,.01)=$PIECE($GET(^TMP("DILIST",$JOB,1,0)),"^",2)
+17 SET ^TMP($JOB,LIST,"B",$PIECE($GET(^TMP("DILIST",$JOB,1,0)),"^",2),+PSSIEN)=""
+18 SET ^TMP($JOB,LIST,+PSSIEN,2)=$PIECE($GET(^TMP("DILIST",$JOB,1,0)),"^",3)
End DoDot:2
End DoDot:1
+19 SET ^TMP($JOB,LIST,0)=$SELECT(CNT>0:CNT,1:-1_"^"_"NO DATA FOUND")
+20 KILL ^TMP("DILIST",$JOB)
+21 QUIT
+22 ;
SETSCRN ;Set Screen for inactive Solutions
+1 ;Naked reference below refers to ^PS(52.7,+Y,"I")
+2 SET SCR("S")="S ND=$P($G(^(""I"")),U) I ND=""""!(ND>PSSFL)"
+3 QUIT