PSIVORA1 ;BIR/MLM-UTILITIES FOR IV FLUIDS - OE/RR INTERFACE (CONT) ;05 FEB 97 / 1:30 PM ;;5.0; INPATIENT MEDICATIONS ;**58,110**;16 DEC 97 ; ; Reference to ^PS(51.2 is supported by DBIA 2178. ; Reference to ^PS(55 is supported by DBIA 2191. ; Reference to ^PS(52.6 is supported by DBIA 1231. ; Reference to ^PS(52.7 is supported by DBIA 2173. ; Reference to ^VA(200 is supported by DBIA 10060. ; LOCKERR ; Display msg. if lock is unsuccessful. W $C(7),!!,"This order is being edited by another user." S OREND=1 Q ; EDIT ; Edit an existing order. I ORSTS=3 W !,$C(7),"Order must be removed from HOLD before editing." S OREND=1 Q I ORSTS=7 W !,$C(7),"Expired orders cannot be edited." S OREND=1 Q D NEWENT^PSIVORFE S ON=ORPK S:ON["V" ON55=+ON D @$S(ON["V":"GT55^PSIVORFB",1:"GT531^PSIVORFA("_DFN_","""_ON_""")") F X=2,3,9,11,"IVRM" S P(X)="" S P("RES")=$S(ORSTS=11:P("RES"),1:"E") I "EN"[P("RES") S (PSIVOK,EDIT)="57^58^59^1^66" E D REDIT N DONE S PSJORNP=+P(6) K ON55 D ENED^PSIVORV1,GTFLDS^PSIVORFE I $G(DONE) S OREND=1 Q I PSJORSTS=11 W !,"...updating order..." D UPD100^PSIVORFA,PUT531^PSIVORFA Q S P("LOG")=$$DATE^PSJUTL2(),P("CLRK")=DUZ_U_$P($G(^VA(200,DUZ,0)),U) W !,"...creating new order..." S P(17)="U",P("OLDON")=$S(PSJORSTS=5:+ON_"P",1:+ON_"V") D ENGNN^PSGOETO S ON=DA D SET^PSIVORFE D PUT531^PSIVORFA I P("OLDON")["V",$D(^PS(55,DFN,"IV",+P("OLDON"),2)) S $P(^(2),U,6)=ON_"U",$P(^(2),U,9)="E" Q I P("OLDON")'["V",$D(^PS(53.1,+P("OLDON"),0)) S $P(^(0),U,26,27)=ON_"U"_U_"E" Q ; RENEW ;Renew order through OE/RR. I $S(ORSTS=6:0,ORSTS=7:0,1:1) W !,$C(7),"Only ACTIVE OR EXPIRED orders may be RENEWED." S OREND=1 Q S ON=ORPK D GT55^PSIVORFB,REDIT K ON55 S P(17)="U",P("OLDON")=ON F X=2,3,"IVRM","MR" S P(X)="" D ENED^PSIVORV1,NEWENT^PSIVORFE,EDIT^PSIVEDT W !,"...creating new order..." D ENGNN^PSGOETO S ON=DA_"P",P("RES")="R",P("FRES")="" D SET^PSIVORFE D PUT531^PSIVORFA S $P(^PS(55,DFN,"IV",+P("OLDON"),2),U,6)=ON,$P(^(2),U,9)="R" S P("NEWON")=ON,(ON,ON55)=P("OLDON"),P("FRES")="R",P("RES")="" K ORETURN D RUPTXT^PSIVOREN(DFN,ON) Q ; REDIT ; Set edit string for OE/RR renew. S X=$G(^VA(200,+DUZ,"PS")),EDIT=$S('X:"1^",'$P(X,U,4):"",$P(X,U,4)