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

APCLW2.m

Go to the documentation of this file.
  1. APCLW2 ; IHS/CMI/LAB - AGE BUCKET/DIAGNOSIS REPORT ;
  1. ;;2.0;IHS PCC SUITE;**10**;MAY 14, 2009;Build 88
  1. ;
  1. START ;
  1. W !!?15,"***** RISK FOR OVERWEIGHT PREVALENCE REPORT *****",!!
  1. D @APCLRPT
  1. ;
  1. S APCLTYPE=""
  1. S APCLSEAT=""
  1. K DIR,X,Y
  1. S DIR(0)="S^S:Search Template of Patients;P:Search All Patients"
  1. S DIR("A")=" Select List " D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) EXIT
  1. S APCLTYPE=Y
  1. I APCLTYPE="S" G TEMPLATE
  1. G:$D(DUOUT) START
  1. ;
  1. SEX ;
  1. S DIR(0)="S^M:Males;F:Females;B:Both",DIR("A")="Report should include",DIR("B")="B" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) START
  1. S APCLSEX=Y
  1. ;
  1. INDBEN ;
  1. W !
  1. S DIR(0)="Y",DIR("A")="Do you wish to include ONLY Indian/Alaska Native Beneficiaries",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) SEX
  1. S APCLIBEN=Y
  1. ;
  1. AGE ;
  1. W !
  1. K APCLAGER
  1. S DIR(0)="FO^1:7",DIR("A")="Enter a Range of Ages (e.g. 5-12) [HIT RETURN TO INCLUDE ALL RANGES]" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DUOUT) G INDBEN
  1. I Y="" W !!,"No age range entered. All ages will be included." G BMIR
  1. I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter an age range in the format nnn-nnn. E.g. 2-5, 12-74, 5-20." G AGE
  1. I $P(Y,"-")<2 W !,$C(7),"Cannot run for patients under 2." G AGE
  1. I $P(Y,"-",2)>74 W !,$C(7),"Cannot run for patients over 74." G AGE
  1. S APCLAGER=Y
  1. I APCLRPT'="T" G REPORT
  1. BMIR ;range of BMIs
  1. K APCLBMIR
  1. W !!,"If you want to include only patients whose BMI is within a certain range"
  1. W !,"please enter that range below. For example to include only patients"
  1. W !,"whose BMI is between 30 and 40 enter 30-40. To include only patients"
  1. W !,"whose BMI is over 25 enter 25-99.",!
  1. S DIR(0)="FO^1:7",DIR("A")="Enter a Range of BMIs (e.g. 25-50) [HIT RETURN TO INCLUDE ALL BMI values]" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DUOUT) G AGE
  1. I Y="" W !!,"No BMI range entered. All BMI values will be included." G REPORT
  1. I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a BMI range in the format nnn-nnn. E.g. 20-25, 30.5-99." G BMIR
  1. I $P(Y,"-")<1 W !,$C(7),"Cannot run for BMI values under 1." G AGE
  1. I $P(Y,"-",2)>99 W !,$C(7),"Cannot run for BMI values over 99." G AGE
  1. S APCLBMIR=Y
  1. REPORT ;
  1. S APCLRTYP=""
  1. S DIR(0)="S^R:Report (Printed);S:Sort Template",DIR("A")="Type of Output",DIR("B")="R" KILL DA D ^DIR KILL DIR
  1. G:$D(DIRUT) AGE
  1. S APCLRTYP=Y
  1. I APCLRTYP="S" G STMP
  1. SORT ;
  1. S DIR(0)="S^P:Patient Name;A:Age of Patient;B:BMI",DIR("A")="Sort the report by",DIR("B")="P" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) AGE
  1. S APCLSORT=Y
  1. IDENT ;
  1. S DIR(0)="Y",DIR("A")="Do you wish to suppress patient identifying data (name,chart #)",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) SORT
  1. S APCLIDEN=Y
  1. G ZIS
  1. STMP ;
  1. K APCLSTMP,APCLSNAM
  1. D ^APCLSTMP
  1. I $G(APCLSTMP)="" G REPORT
  1. ZIS ;
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G STMP
  1. S XBRC="^APCLW21",XBRP="^APCLW2P",XBNS="APCL",XBRX="EXIT^APCLW2"
  1. D ^XBDBQUE
  1. D EXIT
  1. Q
  1. EXIT ;
  1. K APCLSORT,APCLIDEN,APCLAGER,APCLSEX,APCL1YR,APCL3YR,APCL80,APCLA,APCLAGE,APCLAGER,APCLBD,APCLBHGH,APCLBMI,APCLBTH,APCLCHT,APCLCWT,APCLDT,APCLER,APCLGHT,APCLGRAN,APCLGWT,APCLHGHA,APCLHRN
  1. K APCLJOB,APCLLENG,APCLMGI,APCLMHT,APCLMWT,APCLNAME,APCLNN,APCLOBE,APCLOVR,APCLPG,APCLQUIT,APCLREF,APCLROHT,APCLROWT,APCLRPT,APCLSEX,APCLSEXP,APCLSORT,APCLSRT,APCLTEXT,APCLX,APCLY,APCLIBEN,APCLCLAS
  1. K DIR,DA,DIC,J,K,M,S,X,Y,APCLSEAT,APCLTYPE
  1. Q
  1. ;
  1. V ;
  1. W ?26,"LIST OF PATIENTS AT NHANES 85-94TH PERCENTILE"
  1. W !,"This report will produce a listing of all patients of the age and sex ",!,"that you specify, who are, based on the BMI, considered overweight.",!
  1. Q
  1. B ;
  1. W ?24,"LIST OF PATIENTS >=NHANES 95TH PERCENTILE"
  1. W !,"This report will produce a listing of all patients of the age and sex ",!,"that you specify, who are, based on the BMI, considered obese.",!
  1. Q
  1. C ;
  1. W ?18,"COMBINED LIST OF PATIENTS NHANES 85-100TH PERCENTILE"
  1. W !,"This report will produce a listing of all patients of the age and sex ",!,"that you specify, who are, based on the BMI, considered overweight or obese.",!
  1. Q
  1. T ;
  1. W ?33,"PATIENT LIST"
  1. W !,"This report will produce a listing of all patients of the age and sex ",!,"that you specify. The report will list their weight, height and BMI.",!
  1. Q
  1. E ;
  1. W ?5,"LIST OF PATIENTS WITH POTENTIAL HEIGHT OR WEIGHT ERROR"
  1. W !,"This report will produce a listing of all patients of the age and sex ",!,"that you specify, whose BMI falls below or exceeds the reasonable data check",!,"limits as shown in the BMI Standard reference table.",!
  1. W "These patient records should be checked for possible inaccurate height or ",!,"weight entries.",!
  1. Q
  1. ;
  1. TEMPLATE ;If Template was selected
  1. ;
  1. W ! S DIC("S")="I $P(^(0),U,4)=9000001!($P(^(0),U,4)=2)" S DIC="^DIBT(",DIC("A")="Enter Patient SEARCH TEMPLATE name: ",DIC(0)="AEMQ" D ^DIC K DIC,DA,DR,DICR
  1. I Y=-1 S APCLQUIT="" K APCLTYPE G START
  1. S APCLSEAT=+Y
  1. G:$D(DIRUT) START
  1. G SEX
  1. ;