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

APCLW2P.m

Go to the documentation of this file.
  1. APCLW2P ; IHS/CMI/LAB - print dx by age ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. START ;
  1. S APCL80="",$P(APCL80,"-",80)="-"
  1. S (APCLPG,APCLSEXP)=0
  1. K APCLQUIT
  1. D HEAD I APCLGRAN=0 W !,"NO PATIENT DATA TO REPORT",! G DONE
  1. I APCLRTYP="S" W !!,"Search Template ",$P($G(^DIBT(APCLSTMP,0)),U)," has been created.",!,"A total of ",APCLGRAN," patients were added to the template.",! G DONE
  1. S APCLSRT="" F S APCLSRT=$O(^XTMP("APCLW2",APCLJOB,APCLBTH,"PATS",APCLSRT)) Q:APCLSRT=""!($D(APCLQUIT)) D PAT
  1. G:$D(APCLQUIT) DONE
  1. I $Y>(IOSL-15) D HEAD G:$D(APCLQUIT) DONE
  1. W !!,"TOTAL NUMBER OF PATIENTS: ",APCLGRAN
  1. W !!,"* Usable Patient Records are defined as:",!?4,"1). Having a visit within the past 3 years (active users)",!?4,"2). Having current height and weight measurements recorded."
  1. W !?6,"- ages 2-19 must have ht and wt taken on the same day within the past year"
  1. W !?6,"- ages 20-74 must have ht since age 19 and wt taken in the past 3 yrs"
  1. W !!,"NOTE: To make sure data is accurate and to eliminate data entry error, table",!,"excludes patient records whose BMI falls above or below the data check limits.",!,"See the BMI Standard Reference Table for a list of these limits."
  1. W !,"Prenatal patients are also excluded."
  1. W !,"***** Values identified on this report as errors are 'possible' errors that"
  1. W !," deserve review but are not 'validated true errors'.",!
  1. I $Y>(IOSL-8) D HEAD Q:$D(APCLQUIT)
  1. W !,"Ages 2-19: 'At Risk for Overweight' is defined as BMI >=85th% but <95th%"
  1. W !?12,"'Overweight' is defined as BMI >= 95th%"
  1. W !,"(per National Center for Health Statistics in collaboration with the National",!,"Center for Chronic Disease Prevention and Health Promotion (2000)."
  1. W !!,"Ages 20-74: 'Overweight' is defined as BMI >=25.0 but <30.0."
  1. W !?13,"'Obese' is defined as BMI >=30.0"
  1. W !,"(per Clinical Guidelines on the Identification, Evaluation,"
  1. W !," and Treatment of Overweight and Obesity in Adults. Bethesda, Md: NHlBI, 1998)"
  1. DONE D DONE^APCLOSUT
  1. K ^XTMP("APCLW2",APCLJOB,APCLBTH),APCLJOB,APCLBTH
  1. Q
  1. PAT ;
  1. S DFN=0 F S DFN=$O(^XTMP("APCLW2",APCLJOB,APCLBTH,"PATS",APCLSRT,DFN)) Q:DFN'=+DFN!($D(APCLQUIT)) S R=^XTMP("APCLW2",APCLJOB,APCLBTH,"PATS",APCLSRT,DFN) D
  1. .I $Y>(IOSL-4) D HEAD Q:$D(APCLQUIT)
  1. .W ! I 'APCLIDEN W $E($P(R,U),1,15),?17,$J($P(R,U,2),6)
  1. .W ?25,$J($P(R,U,3),5,1),?33,$J($P(R,U,4),5,1),?40,$E($P(R,U,5),4,5),"/",$E($P(R,U,5),6,7),"/",(1700+$E($P(R,U,5),1,3)),?51,$P(R,U,6),?57,$P(R,U,7),?61,$J($P(R,U,8),5,1),?70,$P(R,U,9),?77,$P(R,U,10) ; - 4 digit yr
  1. .;IHS/CMI/LAB
  1. Q
  1. I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQUIT="" Q
  1. HEAD1 ;
  1. W:$D(IOF) @IOF S APCLPG=APCLPG+1
  1. W !
  1. S X=$P(^DIC(4,DUZ(2),0),"^")
  1. W !,$P(^VA(200,DUZ,0),"^",2),?(80-$L(X)/2),X,?71,"Page ",APCLPG,!
  1. W ?22,"RISK FOR OVERWEIGHT PATIENT LISTING "
  1. ;S APCLTEXT=$S(APCLRPT="T":"PATIENT LISTING",APCLRPT="V":"LIST OF OVERWEIGHT PATIENTS",APCLRPT="B":"LIST OF OBESE PATIENTS",APCLRPT="C":"LIST OF OVERWEIGHT/OBESE PATIENTS",APCLRPT="E":"LIST OF PATIENTS WITH BMI OUTSIDE EDIT RANGE",1:"HUH")
  1. S APCLTEXT="" I APCLRPT="E" S APCLTEXT="LIST OF PATIENTS WITH BMI OUTSIDE EDIT RANGE"
  1. S APCLLENG=$L(APCLTEXT)
  1. I $L(APCLTEXT) W !?(80-APCLLENG)/2,APCLTEXT,!
  1. S APCLTEXT="Report includes: "_$S(APCLSEX="B":"MALES & FEMALES",APCLSEX="F":"FEMALES",APCLSEX="M":"MALES",1:"HUH")_" / "_$S('$D(APCLAGER):"ALL AGES",1:"AGES: "_APCLAGER)
  1. S APCLLENG=$L(APCLTEXT) W !?(80-APCLLENG)/2,APCLTEXT
  1. S APCLTEXT="Report Includes: "_$S(APCLIBEN=1:"INDIAN/ALASKA NATIVES ONLY",APCLIBEN'=1:"ALL BENEFICIARIES")
  1. S APCLLENG=$L(APCLTEXT) W !?(80-APCLLENG)/2,APCLTEXT
  1. ;
  1. I APCLSEAT'="" S APCLTEXT="Search Template of Patients: "_$P(^DIBT(APCLSEAT,0),U)
  1. I APCLSEAT'="" S APCLLENG=$L(APCLTEXT) W !?(80-APCLLENG)/2,APCLTEXT
  1. W !,?66,"(AT RISK",!?41,"DATE OF",?69,"FOR)"
  1. W !,"PATIENT NAME",?17,"HRN #",?25," HT",?33," WT",?41,"WEIGHT",?51,"AGE",?56,"SEX",?61," BMI",?67,"OVERWT",?75,"OBESE"
  1. W !,APCL80
  1. Q