GMVGETD1 ;HOIFO/YH-EXTRACT VITALS/MEASUREMENT RECORDS FOR A GIVEN DATE ;5/10/07
;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
;
; This routine uses the following IAs:
; #4290 - ^PXRMINDX global (controlled)
;
EN1 ;CALLED FROM GMVGETD ENTRY POINT GETVM
K ^TMP($J,"GMRV")
N GJ,GMRDATE,GMRVDA,GMRVTY,GMVCLIO,GMVENTRY
F GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN" S GMRVITY=$O(^GMRD(120.51,"C",GMRVTY,0)) I GMRVITY>0 D SETAR
I $O(^TMP($J,"GMRV",0))'>0 K ^TMP($J,"GMRV") Q
K ^TMP($J,"GRPC")
S GJ=0,GMRDATE=0
F S GMRDATE=$O(^TMP($J,"GMRV",GMRDATE)) Q:GMRDATE'>0 D PRT
QT ;
K ^TMP($J,"GMRV")
Q
SETAR ;
I GMVTYPE'="",GMVTYPE'=GMRVTY Q
S GMRDT=GMVSTART-.000001
F S GMRDT=$O(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT)) Q:(GMRDT'>0)!(GMRDT>GMVEND) D SETND
Q
SETND ;
S GMRVDA=0
F S GMRVDA=$O(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT,GMRVDA)) Q:$L(GMRVDA)'>0 D
.K GMVCLIO
.I GMRVDA=+GMRVDA D
..D F1205^GMVUTL(.GMVCLIO,GMRVDA)
.I GMRVDA'=+GMRVDA D
..D CLIO^GMVUTL(.GMVCLIO,GMRVDA)
.S GMVCLIO(0)=$G(GMVCLIO(0)),GMVCLIO(5)=$G(GMVCLIO(5))
.I GMVCLIO(0)=""!($P(GMVCLIO(0),U,8)="") Q
.S GMVENTRY=GMVCLIO(0)_"|"_GMVCLIO(5)
.D SETUT
.Q
Q
SETUT ;
S ^TMP($J,"GMRV",+$E(GMRDT,1,12),GMRVTY,GMRVDA)=GMVENTRY
Q
PRT ;SAVE V/M BY DATE/TIME
F GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN" I $D(^TMP($J,"GMRV",GMRDATE,GMRVTY)) S GMRVDA=0 F S GMRVDA=$O(^TMP($J,"GMRV",GMRDATE,GMRVTY,GMRVDA)) Q:$L(GMRVDA)'>0 D SETLN^GMVGETD2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVGETD1 1518 printed Oct 16, 2024@17:59:31 Page 2
GMVGETD1 ;HOIFO/YH-EXTRACT VITALS/MEASUREMENT RECORDS FOR A GIVEN DATE ;5/10/07
+1 ;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #4290 - ^PXRMINDX global (controlled)
+5 ;
EN1 ;CALLED FROM GMVGETD ENTRY POINT GETVM
+1 KILL ^TMP($JOB,"GMRV")
+2 NEW GJ,GMRDATE,GMRVDA,GMRVTY,GMVCLIO,GMVENTRY
+3 FOR GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN"
SET GMRVITY=$ORDER(^GMRD(120.51,"C",GMRVTY,0))
IF GMRVITY>0
DO SETAR
+4 IF $ORDER(^TMP($JOB,"GMRV",0))'>0
KILL ^TMP($JOB,"GMRV")
QUIT
+5 KILL ^TMP($JOB,"GRPC")
+6 SET GJ=0
SET GMRDATE=0
+7 FOR
SET GMRDATE=$ORDER(^TMP($JOB,"GMRV",GMRDATE))
if GMRDATE'>0
QUIT
DO PRT
QT ;
+1 KILL ^TMP($JOB,"GMRV")
+2 QUIT
SETAR ;
+1 IF GMVTYPE'=""
IF GMVTYPE'=GMRVTY
QUIT
+2 SET GMRDT=GMVSTART-.000001
+3 FOR
SET GMRDT=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT))
if (GMRDT'>0)!(GMRDT>GMVEND)
QUIT
DO SETND
+4 QUIT
SETND ;
+1 SET GMRVDA=0
+2 FOR
SET GMRVDA=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT,GMRVDA))
if $LENGTH(GMRVDA)'>0
QUIT
Begin DoDot:1
+3 KILL GMVCLIO
+4 IF GMRVDA=+GMRVDA
Begin DoDot:2
+5 DO F1205^GMVUTL(.GMVCLIO,GMRVDA)
End DoDot:2
+6 IF GMRVDA'=+GMRVDA
Begin DoDot:2
+7 DO CLIO^GMVUTL(.GMVCLIO,GMRVDA)
End DoDot:2
+8 SET GMVCLIO(0)=$GET(GMVCLIO(0))
SET GMVCLIO(5)=$GET(GMVCLIO(5))
+9 IF GMVCLIO(0)=""!($PIECE(GMVCLIO(0),U,8)="")
QUIT
+10 SET GMVENTRY=GMVCLIO(0)_"|"_GMVCLIO(5)
+11 DO SETUT
+12 QUIT
End DoDot:1
+13 QUIT
SETUT ;
+1 SET ^TMP($JOB,"GMRV",+$EXTRACT(GMRDT,1,12),GMRVTY,GMRVDA)=GMVENTRY
+2 QUIT
PRT ;SAVE V/M BY DATE/TIME
+1 FOR GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN"
IF $DATA(^TMP($JOB,"GMRV",GMRDATE,GMRVTY))
SET GMRVDA=0
FOR
SET GMRVDA=$ORDER(^TMP($JOB,"GMRV",GMRDATE,GMRVTY,GMRVDA))
if $LENGTH(GMRVDA)'>0
QUIT
DO SETLN^GMVGETD2
+2 QUIT