source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVORE0.m@ 1310

Last change on this file since 1310 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1GMRVORE0 ;HIRMFO/RM/YH-DRIVER TO ENTER VITAL/MEASUREMENTS ORDERS ;8/16/95
2 ;;4.0;Vitals/Measurements;;Apr 25, 1997
3EN1 ; ENTRY FROM ACTION FIELD OF ORDER ENTRY OPTION
4 ;
5 ; SET UP ORDER VARIABLES GMRVSTOP, GMRVSTRT, GMRVAS, GMRVCOM AND
6 ; GMRVORD(
7 ;
8 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))=""
9 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")
10 I $D(ORIFN) S GMRVORD(3)=$G(ORUPCHUK("ORPK")) K ORUPCHUK
11 I $D(GMRVKWIK) S GMRVSTRT=$P(GMRVANSR,"^"),GMRVSTOP=$P(GMRVANSR,"^",2),GMRVAS=$P(GMRVANSR,"^",3),GMRVCOM=$P(GMRVANSR,"^",4) G:'$D(ORIFN) PROC
12 I '$D(ORIFN) S (GMRVSTRT,GMRVSTOP,GMRVAS,GMRVCOM)="" G PROC
13 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)
14 E S GMRVAS=$P(GMRVORD,"^",2,4),GMRVCOM=$P(GMRVORD("O"),"^"),GMRVSTRT=$P(GMRVORD(2),"^",6),GMRVSTOP=$P(GMRVORD(1),"^",9)
15PROC ;
16 ; PROCESS ORDER DEPENDING ON $G(ORACTION)
17 ;
18 I $G(ORACTION)=2,$G(ORSTS)=11 G NOP
19 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)
20 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
21 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
22 I $G(ORACTION)=0!($G(ORACTION)=1)!($G(ORACTION)=2) I $G(ORGY)=9 D REL^GMRVORE3
23 I $G(ORACTION)=3 G:$G(ORSTS)=11 NOP S ORSTS=$S($G(ORSTS)=4:6,1:4) D ST^ORX G Q
24 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
25 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
26 I $G(ORACTION)=6,+$G(ORSTS)=11 S ORSTS="K" D ST^ORX G Q
27 I $G(ORACTION)=6 D DC^ORX5:$G(ORGY)=0,EN1^GMRVORC0:$G(ORGY)=9
28 I $G(ORACTION)=7 D EN2^GMRVORC0
29 I $G(ORACTION)=8 D EN1^GMRVORD0
30 ;
31 ; CLEAN UP VARIABLES
32 ;
33Q ;
34 I GMROUT W !,?4,$C(7),$S($G(ORACTION):"No updating has occurred!!",1:"Order has been deleted!!")
35 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
36 Q
37NOP ;
38 W !!,$C(7),"This action is inappropriate for this order."
39 G Q
40EDCHK ;
41 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)
42 I GMRVORD(4)'="",GMRVORD(6)=GMRVORD(5) W $C(7),!?4,"No change to existing order!!" S GMROUT=1
43 Q
Note: See TracBrowser for help on using the repository browser.