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

BCHRCHP.m

Go to the documentation of this file.
BCHRCHP ; IHS/CMI/LAB - HIGHTLISTS Report ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;IHS/CMI/LAB - tmp to xtmp
 ;
 ;
PRINT ;EP - PRINT TOP TEN RECORDS
 D NOW^%DTC S Y=X D DD^%DT S BCHDT=Y
 S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
 S BCHPG=0
 I BCHTT=0 D HEAD W "NO DATA TO REPORT" G DONE
 S BCHTH=BCHTT/60
PROB ;
 S BCHPROC="P"
 D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 ;
 S (BCHX,C)=0 F  S BCHX=$O(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP PROBS",BCHX)) Q:BCHX'=+BCHX!(C>BCHLNO)!($D(BCHQUIT))  D
 .S BCHY=0 F  S BCHY=$O(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP PROBS",BCHX,BCHY)) Q:BCHY'=+BCHY!($D(BCHQUIT))  S C=C+1 D
 ..S H=$P(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP PROBS",BCHX,BCHY),U,2),P=$P(^(BCHY),U,3)*100,H=H/60
 ..I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 ..I BCHCHRT="L" W !,$P(^BCHTPROB(BCHY,0),U),?36,$J($FN(H,",",1),10),?58,$J(P,5,1) Q
 ..I BCHCHRT="B" W !,$P(^BCHTPROB(BCHY,0),U),?23,$J($FN(H,",",0),6) D
 ... S Q=P+.5,Q=$P(Q,".") W ?32 F I=1:1:Q W "*"
 ...W " (",$J(P,5,1),"%)"
 ...Q
 ..Q
 .Q
 G:$D(BCHQUIT) DONE
TOTALP ;
 I $Y>(IOSL-4) D HEAD G:$D(BCHQUIT) DONE
 W !!,"ALL HEALTH PROBLEMS"
 I BCHCHRT="L" W ?36,$J($FN(BCHTH,",",1),10),?58,$J("100%",5)
 I BCHCHRT="B" W ?23,$J($FN(BCHTH,",",0),6)
 I $Y>(IOSL-5) D HEAD G:$D(BCHQUIT) DONE
 W !!
ACT ;
 G:$D(BCHQUIT) DONE
 S BCHPROC="A"
 I $Y>(IOSL-20) D HEAD G:$D(BCHQUIT) DONE G ACT1
 D @BCHCHRT
ACT1 S (BCHX,C)=0 F  S BCHX=$O(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP ACTS",BCHX)) Q:BCHX'=+BCHX!(C>BCHLNO)!($D(BCHQUIT))  D
 .S BCHY=0 F  S BCHY=$O(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP ACTS",BCHX,BCHY)) Q:BCHY'=+BCHY!($D(BCHQUIT))  S C=C+1 D
 ..S H=$P(^XTMP("BCHRCH",BCHJOB,BCHBT,"TOP ACTS",BCHX,BCHY),U,2),P=$P(^(BCHY),U,3)*100,H=H/60
 ..I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 ..I BCHCHRT="L" W !,$P(^BCHTSERV(BCHY,0),U),?36,$J($FN(H,",",1),10),?58,$J(P,5,1) Q
 ..I BCHCHRT="B" W !,$P(^BCHTSERV(BCHY,0),U),?23,$J($FN(H,",",0),6) D
 ...S Q=P+.5,Q=$P(P,".") W ?32 F I=1:1:Q W "*"
 ...W " (",$J(P,5,1),"%)"
 ...Q
 ..Q
 .Q
 G:$D(BCHQUIT) DONE
TOTALA ;
 I $Y>(IOSL-4) D HEAD G:$D(BCHQUIT) DONE
 W !!,"ALL SERVICES"
 I BCHCHRT="L" W ?36,$J($FN(BCHTH,",",1),10),?58,$J("100%",5)
 I BCHCHRT="B" W ?23,$J($FN(BCHTH,",",0),6)
 I $Y>(IOSL-5) D HEAD G:$D(BCHQUIT) DONE
 W !!
DONE D DONE^BCHUTIL1
 K ^XTMP("BCHRCH",BCHJOB,BCHBT),BCHJOB,BCHBT
 Q
 ;I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I BCHY=0!(Y="^")!($D(DTOUT)) S BCHQUIT="" Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I BCHY=0!(Y=0)!($D(DUOUT)) S BCHQUIT="" Q
HEAD1 ; if terminal
 W:$D(IOF) @IOF
 ;
HEAD2 ; if printer
 S BCHPG=BCHPG+1
 W !,"DATE PRINTED:  ",BCHDT,?$S(BCHCHRT="L":72,1:121),"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 W !,"COMMUNITY HEALTH REPRESENTATIVE REPORT 13 -- HIGHLIGHTS"
 W !,"TOP ",BCHLNO," HEALTH PROBLEMS AND SERVICES"
 S BCHPROGN=$S(BCHPRG:$P(^BCHTPROG(BCHPRG,0),U)_" ("_$P(^(0),U,5)_")",1:"ALL"),X=$L(BCHPROGN)+10
 W !,"PROGRAM:  ",BCHPROGN
 S BCHPROVN=$S(BCHPROVT="O":$P(^VA(200,BCHCHR1,0),U),1:"ALL"),X=$L(BCHPROGN)+10
 W !,"PROVIDER:  ",BCHPROVN
 W !,"PATIENTS: ",BCHREGN
 W !,"REPORTING PERIOD:  ",BCHBDD,"  TO  ",BCHEDD,!
 I BCHCHRT="L" D L
 I BCHCHRT="B" D B
 Q
L ;
 Q:$G(BCHPROC)=""
 W !,$S(BCHPROC="P":"HEALTH PROBLEM",1:"SERVICE"),?35,"SERVICE & TRAVEL",?58,"% OF TOTAL",!?40,"HOURS"
 W !,$TR($J(" ",80)," ","-")
 Q
B ;
 Q:$G(BCHPROC)=""
 W !,$S(BCHPROC="P":"HEALTH PROBLEM",1:"SERVICE"),?23,"  S+T" S J=38 F I=10:10:100 W ?J,I,"%" S J=J+10
 W !?23,"HOURS" S J=41 F I=1:1:10 W ?J,"|" S J=J+10