source: FOIAVistA/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVORDG.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1GMRVORDG ;HIRMFO/RM-DGOERR EVENT DRIVER INTERFACE. ;4/2/96
2 ;;4.0;Vitals/Measurements;**2**;Apr 25, 1997
3EN4 ; ENTRY FROM DGPM MOVEMENT EVENTS PROTOCOL
4 G Q4:$G(DGPMA)=""!("^1^2^3^22^23^24^25^"[("^"_$P($G(DGPMA),"^",18)_"^")) S GMRVDGZN=$P($G(DGPMA),"^")_"^"_$P($G(DGPMA),"^",6),GMRVDGZN(0)=$P($G(DGPMP),"^")_"^"_$P($G(DGPMP),"^",6) G Q4:GMRVDGZN=GMRVDGZN(0)
5 S GMRVDGDT=$P($G(DGPMA),"^"),GMRVOE=$S("^1^3^4^5^"[("^"_$P($G(DGPMA),"^",2)_"^")&($P($G(DGPMA),"^",18)'=41):1,$P($G(DGPMA),"^",2)=2!($P($G(DGPMA),"^",18)=41):0,1:"") G:GMRVOE="" Q4
6 D DCALL:GMRVOE,DCHK:'GMRVOE
7Q4 K GMRVDGZN,GMRVDGDT,GMRVOE D KVAR^VADPT
8 Q
9DCALL ; DC ALL NON-DC'D ORDERS
10 S ORUPKG=$O(^ORD(100.98,"B","VITALS/MEASUREMENTS",0)) G Q4:'ORUPKG
11 S GMRVP=DFN_";DPT("
12 F GMRX=0:0 S GMRX=$O(^OR(100,"AO",GMRVP,GMRX)) Q:GMRX'>0 F GMRVORDA=0:0 S GMRVORDA=$O(^OR(100,"AO",GMRVP,GMRX,ORUPKG,GMRVORDA)) Q:GMRVORDA'>0 D DC
13 K GMRVORDA,GMRVP,GMRVSTAT,GMRVX,GMRVSTDT,ORIFN,ORUPKG
14 Q
15DC ; CHANGE ORDER STATUS IF NECESSARY
16 K ORUPCHUK
17 D EN^ORX8(GMRVORDA)
18 S GMRVSTDT=+ORUPCHUK("ORSTRT"),GMRVSTAT=+ORUPCHUK("ORSTS")
19 K ORUPCHUK
20 Q:GMRVSTAT=1!(GMRVSTAT=2)!(GMRVSTDT>GMRVDGDT&(GMRVSTAT'=8)) S ORIFN=GMRVORDA
21 I GMRVSTAT'=8 D NOW^%DTC S ORETURN("ORSTS")=1,ORETURN("ORSTOP")=%,ORETURN("OREVENT")="" D:GMRVSTAT'=11 RETURN^ORX K %,%H,ORETURN
22 I GMRVSTAT=8 S ORSTS="K" D ST^ORX K ORSTS
23 Q
24DCHK ; CHECK TO SEE IF ORDERS NEED TO BE DC'D
25 S GMRVSITE=$O(^GMRD(120.57,"B","HOSPITAL",0)),GMRVSITE(0)=$S($D(^GMRD(120.57,+GMRVSITE,0)):^(0),1:"") G QCHK:'$P(GMRVSITE(0),"^",3)&'$P(GMRVSITE(0),"^",4)
26 S X=GMRVDGDT D H^%DTC S %H=%H_","_(%T-1) D YMD^%DTC S VAINDT=X_$S(%:%,1:"")
27 D INP^VADPT S GMRVWRD(0)=VAIN(4) S VAINDT=GMRVDGDT D INP^VADPT S GMRVWRD(1)=VAIN(4)
28 I $P(GMRVSITE(0),"^",3),+GMRVWRD(0)'=+GMRVWRD(1) D DCALL G QCHK
29 I $P(GMRVSITE(0),"^",4) S GMRVSRV(0)=$S($D(^DIC(42,+GMRVWRD(0),0)):$P(^(0),"^",3),1:""),GMRVSRV(1)=$S($D(^DIC(42,+GMRVWRD(1),0)):$P(^(0),"^",3),1:"") I GMRVSRV(0)'=GMRVSRV(1) D DCALL
30QCHK K GMRVSITE,GMRVWRD,GMRVSRV
31 Q
Note: See TracBrowser for help on using the repository browser.