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

BUD2RP6G.m

Go to the documentation of this file.
  1. BUD2RP6G ; IHS/CMI/LAB - UDS REPORT DRIVER TABLE 6B 30 Dec 2012 8:09 PM 14 Dec 2012 1:24 PM ;
  1. ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
  1. ;
  1. ;
  1. ;----------
  1. AWS2 ;EP
  1. W:$D(IOF) @IOF
  1. W !,$$CTR($$LOC,80)
  1. W !,$$CTR("UDS 2012",80)
  1. W !!,"All Patients 18 and older w/o BMI or does not have a follow-up plan (Table 6B)",!
  1. D GENI^BUD2RP6F
  1. D PAUSE^BUD2RP6F
  1. W !!,"This report provides a list of all patients 18 years and older who do"
  1. W !,"not have documente BMI percentile on the last visit during the report"
  1. W !,"period or on any visit within the last 6 months of the last visit during"
  1. W !,"the report period, or who are not overweight or underweight, or does not"
  1. W !,"have a follow-up plan documented, had a medical visit during the report"
  1. W !,"period, and were ever seen after their 18th birthday."
  1. W !
  1. Q
  1. AWS2L ;EP
  1. S BUDP=0,BUDQUIT=0,BUDTOT=0
  1. D AWS2H Q:BUDQUIT
  1. I '$D(^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2")) W !!,"No patients to report.",! Q
  1. D AWS2L1
  1. I $Y>(IOSL-3) D AWS2H Q:BUDQUIT
  1. W !!,"TOTAL PATIENTS WITHOUT ADULT WEIGHT SCREEN OR FOLLOW-UP PLAN: ",BUDTOT,!
  1. Q
  1. AWS2L1 ;
  1. I $Y>(IOSL-7) D AWS2H Q:BUDQUIT
  1. S BUDAGE="" F S BUDAGE=$O(^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2",BUDAGE)) Q:BUDAGE=""!(BUDQUIT) D
  1. .S BUDNAME="" F S BUDNAME=$O(^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2",BUDAGE,BUDNAME)) Q:BUDNAME=""!(BUDQUIT) D
  1. ..S BUDCOM="" F S BUDCOM=$O(^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2",BUDAGE,BUDNAME,BUDCOM)) Q:BUDCOM=""!(BUDQUIT) D
  1. ...S DFN=0 F S DFN=$O(^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2",BUDAGE,BUDNAME,BUDCOM,DFN)) Q:DFN'=+DFN!(BUDQUIT) D
  1. ....I $Y>(IOSL-3) D AWS2H Q:BUDQUIT
  1. ....W !,$E($P(^DPT(DFN,0),U,1),1,25),?29,$S($$HRN^AUPNPAT(DFN,BUDSITE)]"":$$HRN^AUPNPAT(DFN,BUDSITE,2),1:$$HRN^AUPNPAT(DFN,DUZ(2),2)),?41,$E(BUDCOM,1,25),?70,$P(^DPT(DFN,0),U,2),?75,BUDAGE,!
  1. ....S BUDTOT=BUDTOT+1
  1. ....S BUDALL=^XTMP("BUD2RP6B",BUDJ,BUDH,"AWS2",BUDAGE,BUDNAME,BUDCOM,DFN)
  1. ....W ?5,$S($P(BUDALL,U,1)]"":$J($P(BUDALL,U,1),6,2),1:""),?25,$P(BUDALL,U,2),?51,$P(BUDALL,U,3)
  1. Q
  1. AWS2H ;
  1. G:'BUDGPG AWS2H1
  1. K DIR I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BUDQUIT=1 Q
  1. AWS2H1 ;
  1. W:$D(IOF) @IOF S BUDGPG=BUDGPG+1
  1. W !,"***** CONFIDENTIAL PATIENT INFORMATION, COVERED BY THE PRIVACY ACT *****"
  1. W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BUDGPG,!
  1. W !,$$CTR("*** RPMS Uniform Data System (UDS) ***",80)
  1. W !,$$CTR("Patient List for Table 6B, Section F",80)
  1. W !,$$CTR("Adult Weight Screen and Follow-up",80),!
  1. W $$CTR($P(^DIC(4,BUDSITE,0),U),80),!
  1. S X="Reporting Period: "_$$FMTE^XLFDT(BUDBD)_" to "_$$FMTE^XLFDT(BUDED) W $$CTR(X,80),!
  1. S X="Population: "_$S($G(BUDBEN)=1:"Indian/Alaskan Native (Classification 01)",$G(BUDBEN)=2:"Not Indian Alaskan/Native (Not Classification 01)",$G(BUDBEN)=3:"All (both Indian/Alaskan Natives and Non 01)",1:"") W $$CTR(X,80),!
  1. W $TR($J("",80)," ","-")
  1. I BUDP=0 D
  1. .W !,"This report provides a list of all patients 18 years and older who do not"
  1. .W !,"have a documented BMI percentile on the last visit during the report"
  1. .W !,"period or on any visit within the last 6 months of the last visit during"
  1. .W !,"the report period, or who are not overweight or underweight, or does not"
  1. .W !,"have a follow-up plan documented, had a medical visit during the report"
  1. .W !,"period, and were ever seen after their 18th birthday."
  1. .W !,"Age is calulated as of December 31."
  1. W !!,"PATIENT NAME",?34,"HRN",?41,"COMMUNITY",?70,"SEX",?75,"AGE"
  1. W !?5,"BMI PERCENTILE",?25,"WEIGHT STATUS",?51,"FOLLOW-UP PLAN"
  1. W !,$TR($J("",80)," ","-"),!
  1. S BUDP=1
  1. Q
  1. ;
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP - Return location name from file 4 based on DUZ(2).
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")