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

APCLW6P.m

Go to the documentation of this file.
APCLW6P ; IHS/CMI/LAB - print dx by age ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCL80="",$P(APCL80,"-",80)="-"
 S (APCLPG,APCLSEXP)=0
 K APCLQUIT
 D HEAD I '$D(^XTMP("APCLW6",APCLJ,APCLH,"PATIENTS")) W !,"NO PATIENT DATA TO REPORT",! G DONE
 S APCLMOVE="UP" D START1
 I $D(APCLQUIT) D DONE Q
 S APCLMOVE="DOWN" D START1
 I $D(APCLQUIT) D DONE Q
 W !!,"TOTAL NUMBER OF PATIENTS: ",APCLGRAN
DONE ;
 K ^XTMP("APCLW6",APCLJ,APCLH),APCLJ,APCLH
 D DONE^APCLOSUT
 Q
START1 ;
 S APCLAGE="" F  S APCLAGE=$O(^XTMP("APCLW6",APCLJ,APCLH,"PATIENTS",APCLMOVE,APCLAGE)) Q:APCLAGE=""!($D(APCLQUIT))  D PAT
 Q
PAT ;
 S APCLNAME="" F  S APCLNAME=$O(^XTMP("APCLW6",APCLJ,APCLH,"PATIENTS",APCLMOVE,APCLAGE,APCLNAME)) Q:APCLNAME=""!($D(APCLQUIT))  D
 .S DFN=0 F  S DFN=$O(^XTMP("APCLW6",APCLJ,APCLH,"PATIENTS",APCLMOVE,APCLAGE,APCLNAME,DFN)) Q:DFN'=+DFN!($D(APCLQUIT))  D
 ..S R=^XTMP("APCLW6",APCLJ,APCLH,"PATIENTS",APCLMOVE,APCLAGE,APCLNAME,DFN)
 ..I $Y>(IOSL-3) D HEAD Q:$D(APCLQUIT)
 ..W !!,$E(APCLNAME,1,30),?31,$$HRN^AUPNPAT(DFN,DUZ(2)),?38,APCLAGE,?42,$P(^DPT(DFN,0),U,2),?46,$E($$COMMRES^AUPNPAT(DFN),1,15),?63,$E($$TRIBE^AUPNPAT(DFN),1,15)
 ..W !?3,"HT: ",$J($P(R,U,3),5,1),?13,"HT DATE: ",$$DATE($P(R,U,4)),?32,"WT:  ",$J($P(R,U,1),6,1),?45,"WT DATE: ",$$DATE($P(R,U,2)),?65,"BMI: ",$J($P(R,U,5),5,1)
 ..W !?3,"HT: ",$J($P(R,U,9),5,1),?13,"HT DATE: ",$$DATE($P(R,U,10)),?32,"WT:  ",$J($P(R,U,7),6,1),?45,"WT DATE: ",$$DATE($P(R,U,8)),?65,"BMI: ",$J($P(R,U,11),5,1)
 Q
 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
HEAD1 ;
 W:$D(IOF) @IOF S APCLPG=APCLPG+1
 W !
 S X=$P(^DIC(4,DUZ(2),0),"^")
 W !,$P(^VA(200,DUZ,0),"^",2),$$CTR(X,80),?71,"Page ",APCLPG,!
 W !,"List of Patients moving from the normal to the "
 W !,"NHANES 85th-94th Percentile or have moved from the NHANES 85th-94th"
 W !,"Percentile to the NHANES >= 95th Percentile"
 S APCLTEXT="Report includes: "_$S(APCLSEX="B":"MALES & FEMALES",APCLSEX="F":"FEMALES",APCLSEX="M":"MALES",1:"HUH") W !!,$$CTR(APCLTEXT,80)
 I APCLTYPE="P" S X="Age Range: "_APCLLOWA_" - "_APCLHGHA W !,$$CTR(X,80)
 I APCLSEAT'="" S APCLTEXT="Search Template of Patients: "_$P(^DIBT(APCLSEAT,0),U)
 I APCLSEAT'="" S APCLLENG=$L(APCLTEXT) W !?(80-APCLLENG)/2,APCLTEXT
 W !!,"PATIENT NAME",?31,"HRN #",?38,"AGE",?42,"M/F",?46,"COMMUNITY",?63,"TRIBE"
 W !,APCL80
 Q
DATE(D) ;EP
 I D="" Q ""
 Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_$E(D,2,3)
 ;
CTR(X,Y) ;EP - Center X in a field Y wide.
 Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X