PSJOCOR ;BIR/MV - DISPLAY CPRS ORDER CHECKS ;6 Jun 07 / 3:37 PM
;;5.0;INPATIENT MEDICATIONS ;**181,252,281**;16 DEC 97;Build 113
;
; Reference to ^PSDRUG( is supported by DBIA# 2192.
; Reference to ^OROCAPI is supported by DBIA# 5367.
; Reference to ^ORX8 is supported by DBIA #5469.
;
CPRS(PSPDRG) ;Perform Aminoglycoside checks for IV drugs
;PSPDRG - Drug array in format of PDRG(n)=IEN (#50) ^ Drug name
;Only need to display Aminoglycoside once for an order. If PSJQUIT is set that means it already displayed
NEW PSJDD,PSJQUIT,PSJPAUSE,PSJCNT,VAIN
S PSJPAUSE=0
W !!
F PSJCNT=0:0 S PSJCNT=$O(PSPDRG(PSJCNT)) Q:'PSJCNT Q:$G(PSJQUIT) S PSJDD=+PSPDRG(PSJCNT) D
. D DOC(DFN,$$OROI(+PSJDD))
. D GOC(DFN,($P(PSPDRG(PSJCNT),U,2)))
. D AOC(DFN,$$VAPROD(+PSJDD))
I ($Y+4)>IOSL,PSJPAUSE W ! D PAUSE^PSJMISC() W @IOF
Q
;
OROI(PSJDD) ;Get CPRS OI
;PSJDD - Drug IEN(#50)
NEW PSJOI
Q:'+$G(PSJDD) ""
S PSJOI=+$P($G(^PSDRUG(+PSJDD,2)),U)
Q:'PSJOI ""
Q $$OITM^ORX8(PSJOI,"99PSP")
;
DOC(DFN,PSJOROI) ;DANGEREOUS MEDS FOR PAT > 64 ORDER CHECK
;DFN - Patient IEN
;PSJOROI - CPRS orderable item IEN
NEW X
Q:'+$G(DFN)
Q:'+$G(PSJOROI)
S X=$P($$DOC^OROCAPI(DFN,+PSJOROI),U,4)
I X]"" S PSJPAUSE=1 W "***Dangerous Meds for Patient >64***",!! D WRITE^PSJMISC(X) W !
Q
;
GOC(DFN,PSJDNM) ;GLUCOPHAGE LAB RESULTS ORDER CHECK
;PSJDNM - Drug name from file 50
NEW X
Q:'+$G(DFN)
Q:$G(PSJDNM)=""
S X=$P($$GOC^OROCAPI(DFN,PSJDNM),U,4)
I X]"" S PSJPAUSE=1,PSJQUIT=1 W "***Metformin Lab Results***",!! D WRITE^PSJMISC(X) W !
Q
;
AOC(DFN,PSJPROD) ;AMINOGLYCOSIDE ORDERED ORDER CHECK
;PSJPROD - VA Product File (#50.68) IEN.
;PSJQUIT is set so Aminoglycoside is only warn once per session.
NEW X
Q:'+$G(DFN)
Q:'+$G(PSJPROD)
S X=$P($$AOC^OROCAPI(DFN,+PSJPROD),U,4)
I X]"" S PSJPAUSE=1,PSJQUIT=1 W "***Aminoglycoside Ordered****",!! D WRITE^PSJMISC(X) W !
Q
;
VAPROD(PSJDD) ;Return VA PRODUCT IEN (50.68)
;PSJDD - Dispense drug IEN (50)
Q $P($G(^PSDRUG(+PSJDD,"ND")),U,3)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSJOCOR 2058 printed Dec 13, 2024@02:08:05 Page 2
PSJOCOR ;BIR/MV - DISPLAY CPRS ORDER CHECKS ;6 Jun 07 / 3:37 PM
+1 ;;5.0;INPATIENT MEDICATIONS ;**181,252,281**;16 DEC 97;Build 113
+2 ;
+3 ; Reference to ^PSDRUG( is supported by DBIA# 2192.
+4 ; Reference to ^OROCAPI is supported by DBIA# 5367.
+5 ; Reference to ^ORX8 is supported by DBIA #5469.
+6 ;
CPRS(PSPDRG) ;Perform Aminoglycoside checks for IV drugs
+1 ;PSPDRG - Drug array in format of PDRG(n)=IEN (#50) ^ Drug name
+2 ;Only need to display Aminoglycoside once for an order. If PSJQUIT is set that means it already displayed
+3 NEW PSJDD,PSJQUIT,PSJPAUSE,PSJCNT,VAIN
+4 SET PSJPAUSE=0
+5 WRITE !!
+6 FOR PSJCNT=0:0
SET PSJCNT=$ORDER(PSPDRG(PSJCNT))
if 'PSJCNT
QUIT
if $GET(PSJQUIT)
QUIT
SET PSJDD=+PSPDRG(PSJCNT)
Begin DoDot:1
+7 DO DOC(DFN,$$OROI(+PSJDD))
+8 DO GOC(DFN,($PIECE(PSPDRG(PSJCNT),U,2)))
+9 DO AOC(DFN,$$VAPROD(+PSJDD))
End DoDot:1
+10 IF ($Y+4)>IOSL
IF PSJPAUSE
WRITE !
DO PAUSE^PSJMISC()
WRITE @IOF
+11 QUIT
+12 ;
OROI(PSJDD) ;Get CPRS OI
+1 ;PSJDD - Drug IEN(#50)
+2 NEW PSJOI
+3 if '+$GET(PSJDD)
QUIT ""
+4 SET PSJOI=+$PIECE($GET(^PSDRUG(+PSJDD,2)),U)
+5 if 'PSJOI
QUIT ""
+6 QUIT $$OITM^ORX8(PSJOI,"99PSP")
+7 ;
DOC(DFN,PSJOROI) ;DANGEREOUS MEDS FOR PAT > 64 ORDER CHECK
+1 ;DFN - Patient IEN
+2 ;PSJOROI - CPRS orderable item IEN
+3 NEW X
+4 if '+$GET(DFN)
QUIT
+5 if '+$GET(PSJOROI)
QUIT
+6 SET X=$PIECE($$DOC^OROCAPI(DFN,+PSJOROI),U,4)
+7 IF X]""
SET PSJPAUSE=1
WRITE "***Dangerous Meds for Patient >64***",!!
DO WRITE^PSJMISC(X)
WRITE !
+8 QUIT
+9 ;
GOC(DFN,PSJDNM) ;GLUCOPHAGE LAB RESULTS ORDER CHECK
+1 ;PSJDNM - Drug name from file 50
+2 NEW X
+3 if '+$GET(DFN)
QUIT
+4 if $GET(PSJDNM)=""
QUIT
+5 SET X=$PIECE($$GOC^OROCAPI(DFN,PSJDNM),U,4)
+6 IF X]""
SET PSJPAUSE=1
SET PSJQUIT=1
WRITE "***Metformin Lab Results***",!!
DO WRITE^PSJMISC(X)
WRITE !
+7 QUIT
+8 ;
AOC(DFN,PSJPROD) ;AMINOGLYCOSIDE ORDERED ORDER CHECK
+1 ;PSJPROD - VA Product File (#50.68) IEN.
+2 ;PSJQUIT is set so Aminoglycoside is only warn once per session.
+3 NEW X
+4 if '+$GET(DFN)
QUIT
+5 if '+$GET(PSJPROD)
QUIT
+6 SET X=$PIECE($$AOC^OROCAPI(DFN,+PSJPROD),U,4)
+7 IF X]""
SET PSJPAUSE=1
SET PSJQUIT=1
WRITE "***Aminoglycoside Ordered****",!!
DO WRITE^PSJMISC(X)
WRITE !
+8 QUIT
+9 ;
VAPROD(PSJDD) ;Return VA PRODUCT IEN (50.68)
+1 ;PSJDD - Dispense drug IEN (50)
+2 QUIT $PIECE($GET(^PSDRUG(+PSJDD,"ND")),U,3)
+3 ;