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

BQITDBMI.m

Go to the documentation of this file.
BQITDBMI ;GDIT/HS/ALA-BMI ; 04 Feb 2014  9:34 AM
 ;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
 ;
 ;
ABMI ;EP
FD ;  Find data
 W !,$$NOW^XLFDT()
 S BDFN=""
 ;F  S BDFN=$O(^AUPNVMSR("AA",BDFN)) Q:BDFN=""  D
 ;. S BMID=$$PBMI^APCLV(BDFN,DT)
 ;. I $P(BMID,"^",1)'="" S ^ARLIS(BDFN,"BMID")=BMID
 ;Q
 S TMFRAME="T-60M"
 S BBMI=$$FIND1^DIC(9999999.07,,"X","BMI")
 S BDATE=(9999999-DT)
 S EDATE=(9999999-$$DATE^BQIUL1(TMFRAME))
 S BDATE19=$$DATE^BQIUL1("T-12M")
 S BDATE50=$$DATE^BQIUL1("T-24M")
 ;
 F  S BDFN=$O(^AUPNVMSR("AA",BDFN)) Q:BDFN=""  D
 . S DATE=BDATE-.01
 . S CAGE=$$AGE^BQIAGE(BDFN) ; patient's current age
 . F  S DATE=$O(^AUPNVMSR("AA",BDFN,BBMI,DATE)) Q:DATE=""!(DATE>EDATE)  D  Q:QFL
 .. S MDATE=9999999-DATE
 .. I CAGE<19,MDATE<BDATE19 Q
 .. I CAGE>49,MDATE<BDATE50 Q
 .. S BMID=$$PBMI^APCLV(BDFN,DT)
 .. I $P(BMID,"^",1)'="" S QFL=1,^ARLIS(BDFN,"AMID")=BMID
 W !,$$NOW^XLFDT()
 Q