PSIVORH ;BIR/MLM-MAIN DRIVER FOR IV HYPERALS - OE/RR INTERFACE ;09 FEB 93 / 10:02 AM
;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
;
EN ; Entry point called by IV Hyperal protocol.
S X=ORACTION,PSIVAC="O"_$S(X="N":"N",X=1:"E",X=2:"R",X=4:"H",X=6:"D",X="8":"S",1:"") S:X'=5&(X'=7) PSIVUP=+$$GTPCI^PSIVUTL
S DFN=+ORVP,X=ORACTION I X=5!(X=7)!(X=8) D @ORACTION Q
D ENCPP^PSIVOREN Q:'PSJIVORF!('PSJORF) D EN1,DONE^PSIVORA1
Q
;
EN1 ; Take action on existing order.
I ORGY>8 D @ORGY Q
I '$G(ORPK) W !,"INSUFFICIENT INFORMATION, CANNOT CONTINUE." S OREND=1 Q
I ORPK["V",($P($G(^PS(55,DFN,"IV",+ORPK,0)),U,17)="O") D ONCALL^PSIVORV1 Q
S PSJORD=ORPK,PSJORSTS=ORSTS L +@$S(PSJORD["V":"^PS(55,DFN,""IV"",+PSJORD)",1:"^PS(53.1,+PSJORD)"):1 E W $C(7),!!,"This order is being edited by another user." S OREND=1 Q
D @ORACTION L -@$S(PSJORD["V":"^PS(55,DFN,""IV"",+PSJORD)",1:"^PS(53.1,+PSJORD)")
Q
;
NEW ; Enter a new IV Hyperal order.
W !!,"HYPERAL ORDER ENTRY NOT AVAILABLE",!
Q
;
1 ; Edit an existing order.
W !!,"EDIT OF HYPERAL ORDERS NOT AVAILABLE",!
Q
;
2 ; Renew
W !!,"RENEWAL OF HYPERAL ORDERS NOT AVAILABLE",!
Q
;
3 ; Flag
Q
;
4 ; Hold
W !!,"HOLD OF HYPERAL ORDERS NOT AVAILABLE",!
Q
;
5 ; Event
D 5^PSIVORA
Q
;
6 ; Cancel - Delete pending or unreleased orders from Nonverified orders
; (53.1) and Orders (100) files.
I ORSTS=1 W $C(7),!,"This order has already been DISCONTINUED." Q
W !!,"CANCEL HYPERAL ORDERS NOT AVAILABLE",! Q
Q
;
7 ; Purge
D 7^PSIVORA
Q
;
8 ; Print
K DIR S DIR(0)="E" D ^DIR K DIR I $D(DUOUT)!'($D(ORPK)) S OREND=1 Q
S:'$G(PSIVUP) PSIVUP=+$$GTPCI^PSIVUTL S:'$D(PSIVAC) PSIVAC="OS" S (ON,ON55)=ORPK,DFN=+ORVP D @$S(ON["V":"GT55^PSIVORFB",1:"GT531^PSIVORFA("_DFN_","""_ON_""")"),ENDT^PSIVORV1
Q
;
9 ; release order (status=incomplete in 53.1, pending in 100)
S X=ORACTION I X=4!(X=6) D @ORACTION Q
G:"36"'[ORSTS 9^PSIVORA
Q
;
10 ; Verify
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSIVORH 1962 printed Oct 16, 2024@18:05:31 Page 2
PSIVORH ;BIR/MLM-MAIN DRIVER FOR IV HYPERALS - OE/RR INTERFACE ;09 FEB 93 / 10:02 AM
+1 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
+2 ;
EN ; Entry point called by IV Hyperal protocol.
+1 SET X=ORACTION
SET PSIVAC="O"_$SELECT(X="N":"N",X=1:"E",X=2:"R",X=4:"H",X=6:"D",X="8":"S",1:"")
if X'=5&(X'=7)
SET PSIVUP=+$$GTPCI^PSIVUTL
+2 SET DFN=+ORVP
SET X=ORACTION
IF X=5!(X=7)!(X=8)
DO @ORACTION
QUIT
+3 DO ENCPP^PSIVOREN
if 'PSJIVORF!('PSJORF)
QUIT
DO EN1
DO DONE^PSIVORA1
+4 QUIT
+5 ;
EN1 ; Take action on existing order.
+1 IF ORGY>8
DO @ORGY
QUIT
+2 IF '$GET(ORPK)
WRITE !,"INSUFFICIENT INFORMATION, CANNOT CONTINUE."
SET OREND=1
QUIT
+3 IF ORPK["V"
IF ($PIECE($GET(^PS(55,DFN,"IV",+ORPK,0)),U,17)="O")
DO ONCALL^PSIVORV1
QUIT
+4 SET PSJORD=ORPK
SET PSJORSTS=ORSTS
LOCK +@$SELECT(PSJORD["V":"^PS(55,DFN,""IV"",+PSJORD)",1:"^PS(53.1,+PSJORD)"):1
IF '$TEST
WRITE $CHAR(7),!!,"This order is being edited by another user."
SET OREND=1
QUIT
+5 DO @ORACTION
LOCK -@$SELECT(PSJORD["V":"^PS(55,DFN,""IV"",+PSJORD)",1:"^PS(53.1,+PSJORD)")
+6 QUIT
+7 ;
NEW ; Enter a new IV Hyperal order.
+1 WRITE !!,"HYPERAL ORDER ENTRY NOT AVAILABLE",!
+2 QUIT
+3 ;
1 ; Edit an existing order.
+1 WRITE !!,"EDIT OF HYPERAL ORDERS NOT AVAILABLE",!
+2 QUIT
+3 ;
2 ; Renew
+1 WRITE !!,"RENEWAL OF HYPERAL ORDERS NOT AVAILABLE",!
+2 QUIT
+3 ;
3 ; Flag
+1 QUIT
+2 ;
4 ; Hold
+1 WRITE !!,"HOLD OF HYPERAL ORDERS NOT AVAILABLE",!
+2 QUIT
+3 ;
5 ; Event
+1 DO 5^PSIVORA
+2 QUIT
+3 ;
6 ; Cancel - Delete pending or unreleased orders from Nonverified orders
+1 ; (53.1) and Orders (100) files.
+2 IF ORSTS=1
WRITE $CHAR(7),!,"This order has already been DISCONTINUED."
QUIT
+3 WRITE !!,"CANCEL HYPERAL ORDERS NOT AVAILABLE",!
QUIT
+4 QUIT
+5 ;
7 ; Purge
+1 DO 7^PSIVORA
+2 QUIT
+3 ;
8 ; Print
+1 KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)!'($DATA(ORPK))
SET OREND=1
QUIT
+2 if '$GET(PSIVUP)
SET PSIVUP=+$$GTPCI^PSIVUTL
if '$DATA(PSIVAC)
SET PSIVAC="OS"
SET (ON,ON55)=ORPK
SET DFN=+ORVP
DO @$SELECT(ON["V":"GT55^PSIVORFB",1:"GT531^PSIVORFA("_DFN_","""_ON_""")")
DO ENDT^PSIVORV1
+3 QUIT
+4 ;
9 ; release order (status=incomplete in 53.1, pending in 100)
+1 SET X=ORACTION
IF X=4!(X=6)
DO @ORACTION
QUIT
+2 if "36"'[ORSTS
GOTO 9^PSIVORA
+3 QUIT
+4 ;
10 ; Verify
+1 QUIT