[613] | 1 | PSS52P6 ;BIR/LDT - API FOR INFORMATION FROM FILE 52.6; 5 Sep 03
|
---|
| 2 | ;;1.0;PHARMACY DATA MANAGEMENT;**85**;9/30/97
|
---|
| 3 | ;
|
---|
| 4 | ZERO(PSSIEN,PSSFT,PSSFL,LIST) ;
|
---|
| 5 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 6 | ;PSSFT - Free Text name in IV ADDITIVES file (#52.6).
|
---|
| 7 | ;PSSFL - Inactive flag - "" - All entries.
|
---|
| 8 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 9 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 10 | ; Field Number of the data piece being returned.
|
---|
| 11 | ;Returns PRINT NAME field (#.01), GENERIC DRUG field (#1), DRUG UNIT field (#2),
|
---|
| 12 | ;NUMBER OF DAYS FOR IV ORDER field (#3), USUAL IV SCHEDULE field (#4), ADMINISTRATION TIMES field (#5),
|
---|
| 13 | ;AVERAGE DRUG COST PER UNIT field (#7), INACTIVATION DATE field (#12), CONCENTRATION field (#13),
|
---|
| 14 | ;MESSAGES field (#14), PHARMACY ORDERABLE ITEM field (#15), and USED IN IV FLUID ORDER ENTRY FIELD (#17)
|
---|
| 15 | ;of IV ADDITIVES file (#52.6).
|
---|
| 16 | N DIERR,ZZERR,PSS52P6,SCR,PSS
|
---|
| 17 | I $G(LIST)']"" Q
|
---|
| 18 | K ^TMP($J,LIST)
|
---|
| 19 | I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 20 | I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 21 | S SCR("S")=""
|
---|
| 22 | I +$G(PSSFL)>0 N ND D SETSCRN^PSS52P6A
|
---|
| 23 | I +$G(PSSIEN)>0 N PSSIEN2 S PSSIEN2=$$FIND1^DIC(52.6,"","A","`"_PSSIEN,,SCR("S"),"") D
|
---|
| 24 | .I +PSSIEN2'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 25 | .S ^TMP($J,LIST,0)=1
|
---|
| 26 | .D GETS^DIQ(52.6,+PSSIEN2,".01;1;2;3;4;5;7;12;13;14;15;17","IE","PSS52P6") S PSS(1)=0
|
---|
| 27 | .F S PSS(1)=$O(PSS52P6(52.6,PSS(1))) Q:'PSS(1) D SETZRO^PSS52P6A
|
---|
| 28 | I +$G(PSSIEN)'>0,$G(PSSFT)]"" D
|
---|
| 29 | .I PSSFT["??" D LOOP^PSS52P6A(1) Q
|
---|
| 30 | .D FIND^DIC(52.6,,"@;.01;2","QP",PSSFT,,"B",SCR("S"),,"")
|
---|
| 31 | .I +$G(^TMP("DILIST",$J,0))=0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 32 | .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
|
---|
| 33 | ..S PSSIEN=+^TMP("DILIST",$J,PSSXX,0) K PSS52P6 D GETS^DIQ(52.6,+PSSIEN,".01;1;2;3;4;5;7;12;13;14;15;17","IE","PSS52P6") S PSS(1)=0
|
---|
| 34 | ..F S PSS(1)=$O(PSS52P6(52.6,PSS(1))) Q:'PSS(1) D SETZRO^PSS52P6A
|
---|
| 35 | K ^TMP("DILIST",$J)
|
---|
| 36 | Q
|
---|
| 37 | ;
|
---|
| 38 | QCODE(PSSIEN,PSSFT,PSSFL,LIST) ;
|
---|
| 39 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 40 | ;PSSFT - Free Text name in IV ADDITIVES file (#52.6).
|
---|
| 41 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 42 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 43 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 44 | ; Field Number of the data piece being returned.
|
---|
| 45 | ;Returns PRINT NAME field (#.01), QUICK CODE subfile (#52.61), QUICK CODE field (#.01), STRENGTH field (#1),
|
---|
| 46 | ;USUAL INFUSION RATE field (#2), OTHER PRINT INFO field (#3), USUAL IV SCHEDULE field (#4), ADMINISTRATION TIMES
|
---|
| 47 | ;field (#5), USUAL IV SOLUTION field (#6), and MED ROUTE field (#7) of IV ADDITIVES file (#52.6).
|
---|
| 48 | N DIERR,ZZERR,SCR,PSS
|
---|
| 49 | I $G(LIST)']"" Q
|
---|
| 50 | K ^TMP($J,LIST),^TMP("PSS52P6",$J)
|
---|
| 51 | I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 52 | I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 53 | D QCODE^PSS52P6A
|
---|
| 54 | Q
|
---|
| 55 | ;
|
---|
| 56 | ELYTES(PSSIEN,PSSFT,PSSFL,LIST) ;
|
---|
| 57 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 58 | ;PSSFT - Free Text name in IV ADDITIVES file (#52.6).
|
---|
| 59 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 60 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 61 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 62 | ; Field Number of the data piece being returned.
|
---|
| 63 | ;Returns PRINT NAME field (#.01), ELECTROLYTES subfile (#52.62), ELECTROLYTE field (#.01),
|
---|
| 64 | ;and CONCENTRATION field (#1) of IV ADDITIVES file (#52.6).
|
---|
| 65 | N DIERR,ZZERR,SCR,PSS
|
---|
| 66 | I $G(LIST)']"" Q
|
---|
| 67 | K ^TMP($J,LIST),^TMP("PSS52P6",$J)
|
---|
| 68 | I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 69 | I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 70 | D ELYTES^PSS52P6B
|
---|
| 71 | Q
|
---|
| 72 | ;
|
---|
| 73 | SYNONYM(PSSIEN,PSSFT,PSSFL,LIST) ;
|
---|
| 74 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 75 | ;PSSFT - Free Text name in IV ADDITIVES file (#52.6).
|
---|
| 76 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 77 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 78 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 79 | ; Field Number of the data piece being returned.
|
---|
| 80 | ;Returns PRINT NAME field (#.01), SYNONYM subfile (#52.63), SYNONYM field (#.01) of IV ADDITIVES file (#52.6).
|
---|
| 81 | N DIERR,ZZERR,SCR,PSS
|
---|
| 82 | I $G(LIST)']"" Q
|
---|
| 83 | K ^TMP($J,LIST),^TMP("PSS52P6",$J)
|
---|
| 84 | I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 85 | I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 86 | D SYNONYM^PSS52P6B
|
---|
| 87 | Q
|
---|
| 88 | ;
|
---|
| 89 | INACTDT(PSSIEN) ;
|
---|
| 90 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 91 | ;Returns INACTIVATION DATE field (#12) of IV ADDITIVES file (#52.6).
|
---|
| 92 | N DIERR,ZZERR,PSS52P6,PSS
|
---|
| 93 | I +$G(PSSIEN)'>0 Q -1_"^"_"NO DATA FOUND"
|
---|
| 94 | I +$G(PSSIEN)>0 D GETS^DIQ(52.6,+PSSIEN,"12","I","PSS52P6") S PSS(1)=0 D
|
---|
| 95 | .I '$D(PSS52P6) S PSSINACT=-1_"^"_"NO DATA FOUND" Q
|
---|
| 96 | .F S PSS(1)=$O(PSS52P6(52.6,PSS(1))) Q:'PSS(1) S PSSINACT=PSS52P6(52.6,PSS(1),12,"I")
|
---|
| 97 | Q PSSINACT
|
---|
| 98 | ;
|
---|
| 99 | DRGINFO(PSSIEN,PSSFT,PSSFL,LIST) ;
|
---|
| 100 | ;PSSIEN - IEN of entry in IV ADDITIVES file (#52.6).
|
---|
| 101 | ;PSSFT - Free Text name in IV ADDITIVES file (#52.6).
|
---|
| 102 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 103 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 104 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 105 | ; Field Number of the data piece being returned.
|
---|
| 106 | ;Returns PRINT NAME field (#.01), DRUG INFORMATION subfile (#52.64), DRUG INFORMATION field (#.01)
|
---|
| 107 | ;of IV ADDITIVES file (#52.6).
|
---|
| 108 | N DIERR,ZZERR,PSS52P6,SCR,PSS
|
---|
| 109 | I $G(LIST)']"" Q
|
---|
| 110 | K ^TMP($J,LIST)
|
---|
| 111 | I +$G(PSSIEN)'>0,($G(PSSFT)']"") S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 112 | I $G(PSSIEN)]"",+$G(PSSIEN)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 113 | D DRGINFO^PSS52P6B
|
---|
| 114 | Q
|
---|
| 115 | ;
|
---|
| 116 | DRGIEN(PSS50,PSSFL,LIST) ;
|
---|
| 117 | ;PSS50 - IEN of entry in the DRUG file (#50) [required].
|
---|
| 118 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 119 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 120 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 121 | ; Field Number of the data piece being returned.
|
---|
| 122 | ;Returns PRINT NAME field (#.01) of IV ADDITIVES file (#52.6).
|
---|
| 123 | N DIERR,ZZERR,PSS52P6,SCR,PSS
|
---|
| 124 | I $G(LIST)']"" Q
|
---|
| 125 | K ^TMP($J,LIST)
|
---|
| 126 | I +$G(PSS50)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 127 | D DRGIEN^PSS52P6B
|
---|
| 128 | Q
|
---|
| 129 | ;
|
---|
| 130 | LOOKUP(PSS50P7,PSSFL,LIST) ;
|
---|
| 131 | ;PSS50P7 - IEN of entry in PHARMACY ORDERABLE ITEM file (#50.7).
|
---|
| 132 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 133 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 134 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 135 | ; Field Number of the data piece being returned.
|
---|
| 136 | ;Returns PRINT NAME field (#.01), MESSAGES field (#14), QUICK CODE subfile (#52.61), QUICK CODE field (#.01),
|
---|
| 137 | ;STRENGTH field (#1), USUAL INFUSION RATE field (#2), OTHER PRINT INFO field (#3), USUAL IV SCHEDULE field (#4),
|
---|
| 138 | ;ADMINISTRATION TIMES field (#5), USUAL IV SOLUTION field (#6), MED ROUTE field (#7), SYNONYM subfile (#52.63),
|
---|
| 139 | ;SYNONYM field (#.01) of IV ADDITIVES file (#52.6).
|
---|
| 140 | N DIERR,ZZERR,PSS52P6,SCR
|
---|
| 141 | I $G(LIST)']"" Q
|
---|
| 142 | K ^TMP($J,LIST)
|
---|
| 143 | I +$G(PSS50P7)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 144 | D LOOKUP^PSS52P6B
|
---|
| 145 | Q
|
---|
| 146 | ;
|
---|
| 147 | POI(PSSOI,PSSFL,LIST) ;
|
---|
| 148 | ;PSSOI - IEN of entry in the PHARMACY ORDERABLE ITEM file (#50.7) [required].
|
---|
| 149 | ;PSSFL - Inactive flag - 0 or "" - All entries.
|
---|
| 150 | ; FileMan Date - Only entries with no Inactive Date or an Inactive Date greater than this date.
|
---|
| 151 | ;LIST - Subscript of ^TMP array in the form ^TMP($J,LIST,Field Number where Field Number is the
|
---|
| 152 | ; Field Number of the data piece being returned.
|
---|
| 153 | ;Returns PRINT NAME field (#.01) of IV ADDITIVES file (#52.6).
|
---|
| 154 | N DIERR,ZZERR,PSS52P6,SCR,PSS
|
---|
| 155 | I $G(LIST)']"" Q
|
---|
| 156 | K ^TMP($J,LIST)
|
---|
| 157 | I +$G(PSSOI)'>0 S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 158 | D POI^PSS52P6B
|
---|
| 159 | Q
|
---|
| 160 | C(PSSQCODE,PSSIEN) ;
|
---|
| 161 | ;PSSQCODE - Text name of QUICKCODE [required].
|
---|
| 162 | ;PSSIEN - IEN of entry in the IV ADDITIVES file (#52.6) [required].
|
---|
| 163 | ;Returns 1 if there's an entry in the C x-ref, otherwise a 0.
|
---|
| 164 | I $G(PSSQCODE)']"" Q 0
|
---|
| 165 | I +$G(PSSIEN)'>0 Q 0
|
---|
| 166 | I $D(^PS(52.6,"C",PSSQCODE,PSSIEN)) Q 1
|
---|
| 167 | Q 0
|
---|