source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVGETD1.m@ 1119

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

initial load of FOIAVistA 6/30/08 version

File size: 1.1 KB
Line 
1GMVGETD1 ;HOIFO/YH-EXTRACT VITALS/MEASUREMENT RECORDS FOR A GIVEN DATE ;8/31/99 15:03
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; <None>
6 ;
7EN1 ;CALLED FROM GMVGETD ENTRY POINT GETVM
8 K ^TMP($J,"GMRV")
9 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
10 I $O(^TMP($J,"GMRV",0))'>0 K ^TMP($J,"GMRV") Q
11 N GJ K ^TMP("GRPC") S GJ=0
12 S GMRDATE=0 F S GMRDATE=$O(^TMP($J,"GMRV",GMRDATE)) Q:GMRDATE'>0 D PRT
13QT ;
14 K ^TMP($J,"GMRV") Q
15SETAR ;
16 I GMVTYPE'="",GMVTYPE'=GMRVTY Q
17 F GMRDT=0:0 S GMRDT=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT)) Q:GMRDT'>0 S GMRDATE=9999999-GMRDT I '(GMRDATE>GMRVFDT!(GMRDATE<GMRVSDT)) D SETND
18 Q
19SETND ;
20 F GMRVDA=0:0 S GMRVDA=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT,GMRVDA)) Q:GMRVDA'>0 D SETUT
21 Q
22SETUT Q:$D(^GMR(120.5,GMRVDA,2))
23 S ^TMP($J,"GMRV",+$E(GMRDATE,1,12),GMRVTY,GMRVDA)=""
24 Q
25PRT ;SAVE V/M BY DATE/TIME
26 F GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN" I $D(^TMP($J,"GMRV",GMRDATE,GMRVTY)) F GMRVDA=0:0 S GMRVDA=$O(^TMP($J,"GMRV",GMRDATE,GMRVTY,GMRVDA)) Q:GMRVDA'>0 D SETLN^GMVGETD2
27 Q
Note: See TracBrowser for help on using the repository browser.