44 lines
3.1 KiB
Mathematica
44 lines
3.1 KiB
Mathematica
GMRVORE0 ;HIRMFO/RM/YH-DRIVER TO ENTER VITAL/MEASUREMENTS ORDERS ;8/16/95
|
|
;;4.0;Vitals/Measurements;;Apr 25, 1997
|
|
EN1 ; ENTRY FROM ACTION FIELD OF ORDER ENTRY OPTION
|
|
;
|
|
; SET UP ORDER VARIABLES GMRVSTOP, GMRVSTRT, GMRVAS, GMRVCOM AND
|
|
; GMRVORD(
|
|
;
|
|
S GMROUT=0,X=+$G(ORIFN),GMRVORD=$G(^GMR(120.55,X,0)),GMRVORD("O")=$G(^GMR(120.55,X,"O")),(GMRVORD(1),GMRVORD(2),GMRVORD(3),GMRVORD(4),GMRVORD(5),GMRVORD(6))=""
|
|
I $D(ORIFN) D EN^ORX8(ORIFN) S GMRVORD(1)=ORIFN_"^^^^"_ORUPCHUK("ORPCL")_"^^^^"_ORUPCHUK("ORSTOP")_U_ORUPCHUK("ORL")_U_ORUPCHUK("ORTO"),GMRVORD(2)=U_U_+ORUPCHUK("ORSTS")_U_ORUPCHUK("ORPCL")_U_ORUPCHUK("ORTX",1)_U_ORUPCHUK("ORSTRT")
|
|
I $D(ORIFN) S GMRVORD(3)=$G(ORUPCHUK("ORPK")) K ORUPCHUK
|
|
I $D(GMRVKWIK) S GMRVSTRT=$P(GMRVANSR,"^"),GMRVSTOP=$P(GMRVANSR,"^",2),GMRVAS=$P(GMRVANSR,"^",3),GMRVCOM=$P(GMRVANSR,"^",4) G:'$D(ORIFN) PROC
|
|
I '$D(ORIFN) S (GMRVSTRT,GMRVSTOP,GMRVAS,GMRVCOM)="" G PROC
|
|
I $P(GMRVORD(2),U,3)=11 S GMRVSTRT=$P(GMRVORD(3),U),GMRVSTOP=$P(GMRVORD(3),U,2),GMRVAS=$P(GMRVORD(3),U,3),GMRVCOM=$P(GMRVORD(3),U,6)
|
|
E S GMRVAS=$P(GMRVORD,"^",2,4),GMRVCOM=$P(GMRVORD("O"),"^"),GMRVSTRT=$P(GMRVORD(2),"^",6),GMRVSTOP=$P(GMRVORD(1),"^",9)
|
|
PROC ;
|
|
; PROCESS ORDER DEPENDING ON $G(ORACTION)
|
|
;
|
|
I $G(ORACTION)=2,$G(ORSTS)=11 G NOP
|
|
I $G(ORACTION)=0 I $G(ORGY)=10!($G(ORGY)=0) S $P(GMRVORD(2),"^",5)=$S($P(GMRVORD(2),"^",5)="":$G(ORTX),1:$P(GMRVORD(2),"^",5)) D EN1^GMRVORE1 S:GMROUT&($G(ORGY)=10) OREND=1 G Q:GMROUT!($G(ORGY)=10)
|
|
S GMRVNEW=0 I $G(ORACTION)=1,$G(ORSTS)'=11 W !!,$C(7),"DO YOU WANT TO DISCONTINUE THIS ORDER AND ADD A NEW ONE" S %=1 D YN^DICN W:%=0 !,"Answer 'YES' or 'NO'" G PROC:%=0 G Q:%=2!(%=-1) S GMRVNEW=1,GMRVORD(4)=GMRVSTRT_GMRVAS_GMRVCOM_GMRVSTOP
|
|
I $G(ORACTION)=0!($G(ORACTION)=1)!($G(ORACTION)=2) I $G(ORGY)=0 D ASK^GMRVORE2 D:$G(ORACTION)=1 EDCHK G Q:GMROUT D UNREL^GMRVORE3
|
|
I $G(ORACTION)=0!($G(ORACTION)=1)!($G(ORACTION)=2) I $G(ORGY)=9 D REL^GMRVORE3
|
|
I $G(ORACTION)=3 G:$G(ORSTS)=11 NOP S ORSTS=$S($G(ORSTS)=4:6,1:4) D ST^ORX G Q
|
|
I $G(ORACTION)=4 G:$G(ORSTS)=11 NOP D:$G(ORGY)=0 HOLD^ORX5 I $G(ORGY)=9 S ORSTS=$S($G(ORSTS)=3:6,1:3) D ST^ORX
|
|
I $G(ORACTION)=5,($P($G(OREVENT),";",2)="C"!($P($G(OREVENT),";",2)="A")) S GMRVEV=OREVENT,ORETURN("ORSTS")=$S($P($G(OREVENT),";",2)="C":2,1:6) S:$P($G(OREVENT),";",2)="A" ORETURN("OREVENT")=GMRVSTOP_";C" D RETURN^ORX S OREVENT=GMRVEV
|
|
I $G(ORACTION)=6,+$G(ORSTS)=11 S ORSTS="K" D ST^ORX G Q
|
|
I $G(ORACTION)=6 D DC^ORX5:$G(ORGY)=0,EN1^GMRVORC0:$G(ORGY)=9
|
|
I $G(ORACTION)=7 D EN2^GMRVORC0
|
|
I $G(ORACTION)=8 D EN1^GMRVORD0
|
|
;
|
|
; CLEAN UP VARIABLES
|
|
;
|
|
Q ;
|
|
I GMROUT W !,?4,$C(7),$S($G(ORACTION):"No updating has occurred!!",1:"Order has been deleted!!")
|
|
D KVAR^VADPT K DIC,GMRTX,GMRPK,GMRX,GMRY,GMRRQ,GMRVSTOP,GMRVSTRT,GMRENT,GMRACT,GMRORD,GMRVORD,GMROUT,GMRVAS,GMRVCOM,GMRVDF,GMRVEV,GMRVOIFN,XQH,GMRVT,DIROUT,GMRSTOP,GMRSTRT,GMRVKWIK,GMRVNEW,GMRVOERR,GMRVORAN,DZ,GMRSTR,X1,X2
|
|
Q
|
|
NOP ;
|
|
W !!,$C(7),"This action is inappropriate for this order."
|
|
G Q
|
|
EDCHK ;
|
|
S GMRVORD(5)=GMRVSTRT_GMRVAS_GMRVCOM_GMRVSTOP F I=1:1:$L(GMRVORD(4)) S:'($E(GMRVORD(4),I)="~") GMRVORD(6)=GMRVORD(6)_$E(GMRVORD(4),I)
|
|
I GMRVORD(4)'="",GMRVORD(6)=GMRVORD(5) W $C(7),!?4,"No change to existing order!!" S GMROUT=1
|
|
Q
|