Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMVGETD1

GMVGETD1.m

Go to the documentation of this file.
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