PSGOEL ;BIR/CML3-DISPLAY LOGS ;27 JUN 95 / 6:14 PM
;;5.0;INPATIENT MEDICATIONS;**267**;16 DEC 97;Build 158
;
ENLM(PSGP,PSGORD) ;
S DIR(0)="SAO^1:Short Activity Log;2:Long Activity Log;3:Dispense Log;4:History Log;5:Instructions History",DIR("A")="Select LOG to display: ",DIR("A",1)=" 1 - Short Activity Log"
S DIR("A",2)=" 2 - Long Activity Log",DIR("A",3)=" 3 - Dispense Log"
S DIR("A",4)=" 4 - History Log",DIR("A",5)=" 5 - Instructions History",DIR("A",6)="",DIR("?")="^D ENH^PSGOEL" W ! D ^DIR K DIR G:'Y DONE I Y<3 S AT=$E("SL",Y) D ENA^PSGVW0 G DONE
I Y=4 D ENHIS^PSJHIS(PSGP,PSGORD,"U") Q
I Y=5 N PSJINHIS S PSJINHIS=1 D ENHIS^PSJINHIS(PSGP,PSGORD,"U") Q
I '$O(^PS(55,PSGP,5,+PSGORD,11,0)) W !!,"There is NO DISPENSE LOG for this order at this time."
E S Q=0 F C=1:1 S Q=$O(^PS(55,PSGP,5,+PSGORD,11,Q)) Q:'Q S ND=$G(^(Q,0)) D PDL Q:'Y
;
DONE ;
Q
;
PDL ; print dispense log
I '(C#5) K DIR S DIR(0)="E" W ! D ^DIR Q:'Y
S Y=1,PSGOD=$$ENDTC^PSGMI(+ND),DRG=$$ENDDN^PSGMI($P(ND,"^",2)),HOW=$P("UNKNOWN^THROUGH THE PICK LIST^AS PRE-EXCHANGE UNITS^AS EXTRA UNITS^AS RETURNS","^",$P(ND,"^",5)+1),WHO=$$ENNPN^PSGMI($P(ND,"^",6))
W !!?3,"Date: ",PSGOD,?33,"Drug: ",DRG,!,"Entered: ",HOW W:$P(ND,"^",5)'=1 ?35,"By: ",WHO W !?2,"Units: ",$P(ND,"^",3)
Q
;
ENH ;
W !!?2,"Select '1' to view a SHORT ACTIVITY LOG for this order. A short activity log",!,"shows only the main activities associated with the order."
W !?2,"Select '2' to view a LONG ACTIVITY LOG for this order. A long activity log",!,"shows all activities associated with the order."
W !?2,"Select '3' to view the DISPENSE LOG for this order. The dispense log shows",!,"the information about the order pertaining to the medication(s) dispensed for",!,"it, such as how many, when, by whom, etc."
W !?2,"Select '4' to view the HISTORY LOG for this order. The history log shows",!,"every order associated with this order. Associated orders include orders",!,"created from renewing an order or editing certain fields of an order."
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSGOEL 2050 printed Oct 16, 2024@18:03:03 Page 2
PSGOEL ;BIR/CML3-DISPLAY LOGS ;27 JUN 95 / 6:14 PM
+1 ;;5.0;INPATIENT MEDICATIONS;**267**;16 DEC 97;Build 158
+2 ;
ENLM(PSGP,PSGORD) ;
+1 SET DIR(0)="SAO^1:Short Activity Log;2:Long Activity Log;3:Dispense Log;4:History Log;5:Instructions History"
SET DIR("A")="Select LOG to display: "
SET DIR("A",1)=" 1 - Short Activity Log"
+2 SET DIR("A",2)=" 2 - Long Activity Log"
SET DIR("A",3)=" 3 - Dispense Log"
+3 SET DIR("A",4)=" 4 - History Log"
SET DIR("A",5)=" 5 - Instructions History"
SET DIR("A",6)=""
SET DIR("?")="^D ENH^PSGOEL"
WRITE !
DO ^DIR
KILL DIR
if 'Y
GOTO DONE
IF Y<3
SET AT=$EXTRACT("SL",Y)
DO ENA^PSGVW0
GOTO DONE
+4 IF Y=4
DO ENHIS^PSJHIS(PSGP,PSGORD,"U")
QUIT
+5 IF Y=5
NEW PSJINHIS
SET PSJINHIS=1
DO ENHIS^PSJINHIS(PSGP,PSGORD,"U")
QUIT
+6 IF '$ORDER(^PS(55,PSGP,5,+PSGORD,11,0))
WRITE !!,"There is NO DISPENSE LOG for this order at this time."
+7 IF '$TEST
SET Q=0
FOR C=1:1
SET Q=$ORDER(^PS(55,PSGP,5,+PSGORD,11,Q))
if 'Q
QUIT
SET ND=$GET(^(Q,0))
DO PDL
if 'Y
QUIT
+8 ;
DONE ;
+1 QUIT
+2 ;
PDL ; print dispense log
+1 IF '(C#5)
KILL DIR
SET DIR(0)="E"
WRITE !
DO ^DIR
if 'Y
QUIT
+2 SET Y=1
SET PSGOD=$$ENDTC^PSGMI(+ND)
SET DRG=$$ENDDN^PSGMI($PIECE(ND,"^",2))
SET HOW=$PIECE("UNKNOWN^THROUGH THE PICK LIST^AS PRE-EXCHANGE UNITS^AS EXTRA UNITS^AS RETURNS","^",$PIECE(ND,"^",5)+1)
SET WHO=$$ENNPN^PSGMI($PIECE(ND,"^",6))
+3 WRITE !!?3,"Date: ",PSGOD,?33,"Drug: ",DRG,!,"Entered: ",HOW
if $PIECE(ND,"^",5)'=1
WRITE ?35,"By: ",WHO
WRITE !?2,"Units: ",$PIECE(ND,"^",3)
+4 QUIT
+5 ;
ENH ;
+1 WRITE !!?2,"Select '1' to view a SHORT ACTIVITY LOG for this order. A short activity log",!,"shows only the main activities associated with the order."
+2 WRITE !?2,"Select '2' to view a LONG ACTIVITY LOG for this order. A long activity log",!,"shows all activities associated with the order."
+3 WRITE !?2,"Select '3' to view the DISPENSE LOG for this order. The dispense log shows",!,"the information about the order pertaining to the medication(s) dispensed for",!,"it, such as how many, when, by whom, etc."
+4 WRITE !?2,"Select '4' to view the HISTORY LOG for this order. The history log shows",!,"every order associated with this order. Associated orders include orders",!,"created from renewing an order or editing certain fields of an order."
+5 QUIT