GMVLATS ;HOIFO/YH,FT-QUEUES LATEST VITALS/MEASUREMENTS ;12/27/01 11:08
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #10104 - ^XLFSTR calls (supported)
;
SETBP ;
S GDT=GMRDAT,GDATE=GMRDAT+.00000014
F S GMRDAT=$O(^GMR(120.5,"AA",DFN,GMR(X),GMRDAT)) Q:GMRDAT'>0!(GMRDAT>GDATE) S Y=0 F S Y=$O(^GMR(120.5,"AA",DFN,GMR(X),GMRDAT,Y)) Q:Y'>0 I '$D(^GMR(120.5,+Y,2)) D:X="BP" SETNODE^GMVDS0 D:X="P" SETP
S GMRDAT=GDT K GDT,GDATE
Q
SETP ;
S GMRL=$S($D(^GMR(120.5,Y,0)):^(0),1:"")
N GG S GG=$P(GMRL,"^",8),OK=0 D Q:'OK
. I "REFUSEDPASSUNAVAILABLE"[$$UP^XLFSTR(GG) Q
. I '$D(^GMR(120.5,Y,5,"B")) S OK=1 Q
. I $D(^GMR(120.5,Y,5,"B",GAPICAL)) S OK=1 Q
. I $D(^GMR(120.5,Y,5,"B",GRADIAL)) S OK=1 Q
. I $D(^GMR(120.5,Y,5,"B",GBRACH)) S OK=1 Q
S GMRL1=$P(GMRL,"^") ;adding trailing zeros to time if necessary
S $P(GMRL1,".",2)=$P(GMRL1,".",2)_"0000"
S $P(GMRL1,".",2)=$E($P(GMRL1,".",2),1,4)
S $P(GMRL,"^")=GMRL1
K GMRL1
I GMRL'="" S GMRDATA(X,$P(GMRL,"^"),Y)=$P(GMRL,"^",8),GMRDATS=1 I $P($G(^GMR(120.5,Y,5,0)),"^",4)>0 D CHAR^GMVCHAR(Y,.GMRVARY,GMR(X))
Q
GMVLATS ;HOIFO/YH,FT-QUEUES LATEST VITALS/MEASUREMENTS ;12/27/01 11:08
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10104 - ^XLFSTR calls (supported)
+5 ;
SETBP ;
+1 SET GDT=GMRDAT
SET GDATE=GMRDAT+.00000014
+2 FOR
SET GMRDAT=$ORDER(^GMR(120.5,"AA",DFN,GMR(X),GMRDAT))
IF GMRDAT'>0!(GMRDAT>GDATE)
QUIT
SET Y=0
FOR
SET Y=$ORDER(^GMR(120.5,"AA",DFN,GMR(X),GMRDAT,Y))
IF Y'>0
QUIT
IF '$DATA(^GMR(120.5,+Y,2))
IF X="BP"
DO SETNODE^GMVDS0
IF X="P"
DO SETP
+3 SET GMRDAT=GDT
KILL GDT,GDATE
+4 QUIT
SETP ;
+1 SET GMRL=$SELECT($DATA(^GMR(120.5,Y,0)):^(0),1:"")
+2 NEW GG
SET GG=$PIECE(GMRL,"^",8)
SET OK=0
Begin DoDot:1
+3 IF "REFUSEDPASSUNAVAILABLE"[$$UP^XLFSTR(GG)
QUIT
+4 IF '$DATA(^GMR(120.5,Y,5,"B"))
SET OK=1
QUIT
+5 IF $DATA(^GMR(120.5,Y,5,"B",GAPICAL))
SET OK=1
QUIT
+6 IF $DATA(^GMR(120.5,Y,5,"B",GRADIAL))
SET OK=1
QUIT
+7 IF $DATA(^GMR(120.5,Y,5,"B",GBRACH))
SET OK=1
QUIT
End DoDot:1
IF 'OK
QUIT
+8 ;adding trailing zeros to time if necessary
SET GMRL1=$PIECE(GMRL,"^")
+9 SET $PIECE(GMRL1,".",2)=$PIECE(GMRL1,".",2)_"0000"
+10 SET $PIECE(GMRL1,".",2)=$EXTRACT($PIECE(GMRL1,".",2),1,4)
+11 SET $PIECE(GMRL,"^")=GMRL1
+12 KILL GMRL1
+13 IF GMRL'=""
SET GMRDATA(X,$PIECE(GMRL,"^"),Y)=$PIECE(GMRL,"^",8)
SET GMRDATS=1
IF $PIECE($GET(^GMR(120.5,Y,5,0)),"^",4)>0
DO CHAR^GMVCHAR(Y,.GMRVARY,GMR(X))
+14 QUIT