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

BCHRC5P.m

Go to the documentation of this file.
BCHRC5P ; IHS/CMI/LAB - print dx by age ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;IHS/CMI/LAB - tmp to xtmp
START ;
 S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
 S Y=DT D DD^%DT S BCHDT=Y
 ;S BCHPG=0 D HEAD
 S BCHPG=0
 K BCHQUIT
 I '$D(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA")) W !!,"NO DATA TO REPORT" G DONE
HA ;
 D @("HEAD"_(2-($E(IOST,1,2)="C-"))) ; LAB
 ;
 I $Y>(IOSL-4) D HEAD G:$D(BCHQUIT) DONE
 ;S BCHTM=8888,BCHTF=7777
 W !,"TOTAL",?8,$J(BCHTM,5),?14,$J(BCHTF,5)
 S BCHX=0,J=20 F  S BCHX=$O(^XTMP("BCHRC5",BCHJOB,BCHBT,"TOTAL AGE",BCHX)) Q:BCHX'=+BCHX!($D(BCHQUIT))  D
 .S M=^XTMP("BCHRC5",BCHJOB,BCHBT,"TOTAL AGE",BCHX,"M"),F=^XTMP("BCHRC5",BCHJOB,BCHBT,"TOTAL AGE",BCHX,"F")
 .;S M=2222,F=3333
 .W ?J,$J(M,5) S J=J+6 W ?J,$J(F,5) S J=J+6
 .Q
 S BCHX=0 F  S BCHX=$O(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA",BCHX)) Q:BCHX'=+BCHX!($D(BCHQUIT))  D
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?2,$P(^BCHTPROB(BCHX,0),U,2) ;," ",$E($P(^BCHTPROB(BCHX,0),U),1,5)
 .S M=$S($D(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA",BCHX,"TOTAL","M")):^("M"),1:0),F=$S($D(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA",BCHX,"TOTAL","F")):^("F"),1:0) W ?8,$J(M,5),?14,$J(F,5)
 .S J=20 F I=1:1:$L(BCHRBIN,";") S M=$S($D(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA",BCHX,I,"M")):^("M"),1:"."),F=$S($D(^XTMP("BCHRC5",BCHJOB,BCHBT,"HA",BCHX,I,"F")):^("F"),1:".") W ?J,$J(M,5) S J=J+6 W ?J,$J(F,5) S J=J+6
 ;
DONE D DONE^BCHUTIL1
 K ^XTMP("BCHRC5",BCHJOB,BCHBT),BCHJOB,BCHBT,BCHX
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BCHQUIT="" Q
HEAD1 ; if terminal
 W:$D(IOF) @IOF
HEAD2 ; if printer
 S BCHPG=BCHPG+1
 W !,$P(^VA(200,DUZ,0),U,2),?30,"DATE GENERATED:  ",BCHDT,?70,"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 W ! S X="**********  CHR REPORT NO. 5  **********" W $$CTR^BCHRLU(X,80)
 W ! S X="NUMBER OF SERVICES (LINES OF ASSESSMENT) BY HEALTH PROBLEM, AGE AND SEX" W $$CTR^BCHRLU(X,80)
 S BCHPROGN=$S(BCHPRG:$P(^BCHTPROG(BCHPRG,0),U)_" ("_$P(^(0),U,5)_")",1:"ALL"),X=$L(BCHPROGN)+10
 W !!?((80-X)/2),"PROGRAM:  ",BCHPROGN
 S BCHPROVN=$S(BCHPROVT="O":$P(^VA(200,BCHCHR1,0),U),1:"ALL"),X=$L(BCHPROGN)+10
 W !?((80-X)/2),"PROVIDER:  ",BCHPROVN
 S X=$L("PATIENTS:  "_BCHREGN)
 W !?((80-X)/2),"PATIENTS:  ",BCHREGN
 S X="REPORT DATES:  "_BCHBDD_"  TO  "_BCHEDD W !,$$CTR^BCHRLU(X,80)
 W !!,"HEALTH",?12,"-ALL AGES-" S J=24 F I=1:1:$L(BCHRBIN,";") S K=$P(BCHRBIN,";",I) Q:K=""  W ?J,K S J=J+12
 W !,"PROBLEM",?12,"M     F" S J=24 F I=1:1:$L(BCHRBIN,";") W ?J,"M     F" S J=J+12
 W !,$TR($J(" ",80)," ","-")
 Q