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

APCLADXP.m

Go to the documentation of this file.
APCLADXP ; IHS/CMI/LAB - print dx by age ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCL132="",$P(APCL132,"-",130)=""
 S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
 S (APCLPG,APCLCODE)=0 D HEAD
 K APCLQUIT
 F  S APCLCODE=$O(^XTMP("APCLADX",APCLJOB,APCLBT,"TALLY",APCLCODE)) Q:APCLCODE=""!($D(APCLQUIT))  D AGE
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-4) D HEAD G:$D(APCLQUIT) DONE
 W !,"TOTAL:" S J=39 F I=1:1:$L(APCLBIN,";") S K=$S($D(^XTMP("APCLADX",APCLJOB,APCLBT,"TOTAL","AGE",I)):^(I),1:".") W ?J,$J(K,6) S J=J+9
 W ?J,$J(APCLGRAN,6)
DONE D DONE^APCLOSUT
 K ^XTMP("APCLADX",APCLJOB,APCLBT)
 Q
AGE ;
 I $Y>(IOSL-4) D HEAD Q:$D(APCLQUIT)
 W !,APCLCODE S APCLNARR=$O(^XTMP("APCLADX",APCLJOB,APCLBT,"TALLY",APCLCODE,"")) W ?10,$E(APCLNARR,1,25)
 N I,J,K S J=39 F I=1:1:$L(APCLBIN,";") S K=$S($D(^XTMP("APCLADX",APCLJOB,APCLBT,"TALLY",APCLCODE,APCLNARR,I)):^(I),1:".") W ?J,$J(K,6) S J=J+9
 W ?J,$J(^XTMP("APCLADX",APCLJOB,APCLBT,"TOTAL","CODE",APCLCODE,APCLNARR),6)
 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),?(132-$L(X)/2),X,?120,"Page ",APCLPG,!
 W ?54,"Diagnoses by Age Report",!
 W ?5,"Visit Dates:  ",APCLBDD," to ",APCLEDD,?52,"Type of Visit:  ",$S($D(APCLTYPP):APCLTYPP,1:"ALL"),?90,"Service Category:  ",$S($D(APCLSCP):APCLSCP,1:"ALL"),!
 W ?5,"Location of Encounter:  ",$S($D(APCLLOCP):$E(APCLLOCP,1,20),1:"ALL"),?52,"Clinic:  ",$S($D(APCLCLNP):APCLCLNP,1:"ALL"),?90,"Sex of Patient:  ",$S($D(APCLSEXP):APCLSEXP,1:"BOTH"),!
 W ?5,"Primary Provider:  ",$S($D(APCLPRVP):APCLPRVP,1:"ALL"),?52,"Purpose of Visits:  ",$S($D(APCLPRIM):"Primary Only",1:"Primary and Seconday POV's"),!!?61,"AGE GROUPS"
 N I,J,K W !,"ICD Code",?15,"ICD Narrative" S J=41 F I=1:1:$L(APCLBIN,";") S K=$P(APCLBIN,";",I) Q:K=""  W ?J,K S J=J+9
 W ?J,"TOTAL"
 W !,APCL132
 Q