source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMBMI.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 986 bytes
Line 
1PXRMBMI ; SLC/PKR - National BMI computed finding. ;08/31/2004
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;=========================================================
5BMI(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding to return the BMI.
6 N HDAS,HDATE,HT,HTEMP,WDAS,WDATE,WT,WTEMP
7 ;Get the most recent height measurement
8 S HDATE="",HT=0
9 F Q:HT>0 S HDATE=$O(^PXRMINDX(120.5,"PI",DFN,8,HDATE),-1) Q:HDATE="" D
10 . S HDAS=$O(^PXRMINDX(120.5,"PI",DFN,8,HDATE,""))
11 . K HTEMP
12 . D GETDATA^PXRMVITL(HDAS,.HTEMP)
13 . S HT=(HTEMP("RATE")*2.54)/100
14 I HT=0 S TEST=0,(VALUE,TEXT)="" Q
15 ;Get the most recent weight measurement.
16 S WDATE="",WT=0
17 F Q:WT>0 S WDATE=$O(^PXRMINDX(120.5,"PI",DFN,9,WDATE),-1) Q:WDATE="" D
18 . S WDAS=$O(^PXRMINDX(120.5,"PI",DFN,9,WDATE,""))
19 . K WTEMP
20 . D GETDATA^PXRMVITL(WDAS,.WTEMP)
21 . S WT=WTEMP("RATE")/2.203
22 I WT=0 S TEST=0,(VALUE,TEXT)="" Q
23 S VALUE=WT/(HT*HT)
24 S VALUE=$FN(VALUE,"",1)
25 ;Use date of the weight measurement.
26 S DATE=WDATE,TEST=1,TEXT=""
27 Q
28 ;
Note: See TracBrowser for help on using the repository browser.