PSGGAO ;BIR/CML3-PATIENT AND ORDER LOOK-UPS ;20 JUN 94 / 3:16 PM
;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
ENP ; get patient with active orders(UD & IV orders)
N X,Y F D ENDPT^PSGP D Q:X!(PSGP<0)
. S X=0 Q:PSGP<0
. S X=$O(^PS(55,PSGP,5,"AUS",PSGDT)) Q:X
. F Y="A","C","H","P","S" S X=$O(^PS(55,PSGP,"IV","AIT",Y,PSGDT)) Q:X
. W:'X $C(7),!,"(Patient has NO active orders.)"
Q
;
ENO ; get active order
I $D(PSGP),PSGP S D="C",DIC(0)="QEAIS",DIC="^PS(55,"_PSGP_",5,",DIC("S")="I $D(^PS(55,"_PSGP_",5,+Y,2)),($P(^(2),""^"",4)>"_PSGDT_")",DIC("A")="Select ACTIVE ORDER: " W ! D IX^DIC K DIC Q
;
ENN ; get patient and their non-verified order
F D ENDPT^PSGP Q:$S(PSGP>0:$D(^PS(53.1,"AC",PSGP)),1:0) W $C(7),!,"(Patient has NO non-verified orders.)"
Q
;
ENNO S D="D",DIC("A")="Select NON-VERIFIED ORDER: ",DIC="^PS(53.1,",DIC(0)="QEAI",DIC("S")="I $D(^PS(53.1,""AC"","_PSGP_",+Y))" W ! D IX^DIC K DIC Q
;
ENAO ;
F D ENDPT^PSGP Q:$S(PSGP'>0:1,$O(^PS(55,PSGP,5,"AUS",+PSJPAD)):1,1:$D(^PS(53.1,"AC",PSGP))) W !?3,"(Patient has no orders.)"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSGGAO 1079 printed Dec 13, 2024@02:01:18 Page 2
PSGGAO ;BIR/CML3-PATIENT AND ORDER LOOK-UPS ;20 JUN 94 / 3:16 PM
+1 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
ENP ; get patient with active orders(UD & IV orders)
+1 NEW X,Y
FOR
DO ENDPT^PSGP
Begin DoDot:1
+2 SET X=0
if PSGP<0
QUIT
+3 SET X=$ORDER(^PS(55,PSGP,5,"AUS",PSGDT))
if X
QUIT
+4 FOR Y="A","C","H","P","S"
SET X=$ORDER(^PS(55,PSGP,"IV","AIT",Y,PSGDT))
if X
QUIT
+5 if 'X
WRITE $CHAR(7),!,"(Patient has NO active orders.)"
End DoDot:1
if X!(PSGP<0)
QUIT
+6 QUIT
+7 ;
ENO ; get active order
+1 IF $DATA(PSGP)
IF PSGP
SET D="C"
SET DIC(0)="QEAIS"
SET DIC="^PS(55,"_PSGP_",5,"
SET DIC("S")="I $D(^PS(55,"_PSGP_",5,+Y,2)),($P(^(2),""^"",4)>"_PSGDT_")"
SET DIC("A")="Select ACTIVE ORDER: "
WRITE !
DO IX^DIC
KILL DIC
QUIT
+2 ;
ENN ; get patient and their non-verified order
+1 FOR
DO ENDPT^PSGP
if $SELECT(PSGP>0
QUIT
WRITE $CHAR(7),!,"(Patient has NO non-verified orders.)"
+2 QUIT
+3 ;
ENNO SET D="D"
SET DIC("A")="Select NON-VERIFIED ORDER: "
SET DIC="^PS(53.1,"
SET DIC(0)="QEAI"
SET DIC("S")="I $D(^PS(53.1,""AC"","_PSGP_",+Y))"
WRITE !
DO IX^DIC
KILL DIC
QUIT
+1 ;
ENAO ;
+1 FOR
DO ENDPT^PSGP
if $SELECT(PSGP'>0
QUIT
WRITE !?3,"(Patient has no orders.)"
+2 QUIT