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

AMHRAP2P.m

Go to the documentation of this file.
AMHRAP2P ; IHS/CMI/LAB - print all visit report ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
PRINT ;
 D NOW^%DTC S Y=X D DD^%DT S AMHDT=Y
 S Y=AMHBD D DD^%DT S AMHBDD=Y S Y=AMHED D DD^%DT S AMHEDD=Y
 D COVPAGE^AMHRPTCP
 S (AMHTOT,AMHPG,AMHPTOT,AMHTTOT,AMHNTOT)=0 D HEAD
 K AMHQUIT
 D SORT
 G:$D(AMHQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(AMHQUIT) DONE
 W !?42,"------",?50,"------",?59,"-------",?70,"------",!
 ;W ?28,"Totals:",?40,$J(AMHTOT,8),?48,$J(AMHPTOT,8) S X=AMHTTOT,X=$J((X/60),6,1) W ?58,$J(X,8)
 W ?28,"Totals:",?40,$J(AMHTOT,8) S X=AMHTTOT,X=$J((X/60),6,1) W ?58,$J(X,8)
 W ?68,$J(AMHNTOT,8)
DONE ;
 D DONE^AMHLEIN,^AMHEKL
 K ^XTMP("AMHRAP2",AMHJOB,AMHBTH)
 K AMHBT,AMHET
 Q
SORT ;
 I $Y>(IOSL-6) D HEAD Q:$D(AMHQUIT)
 S AMHSORT="" F  S AMHSORT=$O(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TOTAL",AMHSORT)) Q:AMHSORT=""!($D(AMHQUIT))  D P
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(AMHQUIT)
 S AMHSRT2=$O(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TOTAL",AMHSORT,""))
 S AMHPRNT=AMHSORT I AMHRPROC="DATE" S Y=AMHPRNT D DD^%DT S AMHPRNT=Y
 W !,$E(AMHPRNT,1,23),?26,$E(AMHSRT2,1,12),?40,$J(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TOTAL",AMHSORT,AMHSRT2),8)
 W ?48,$S($D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"PATIENT",AMHSORT,AMHSRT2)):$J(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"PATIENT",AMHSORT,AMHSRT2),8),1:$J(0,8))
 I $D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TIME TOTAL",AMHSORT,AMHSRT2)) S X=^(AMHSRT2),X=$J((X/60),1,1) W ?58,$J(X,8)
 W ?68,$S($D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"# SERVED",AMHSORT,AMHSRT2)):$J(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"# SERVED",AMHSORT,AMHSRT2),8),1:$J(0,8))
 S AMHTOT=AMHTOT+^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TOTAL",AMHSORT,AMHSRT2)
 S AMHPTOT=AMHPTOT+$S($D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"PATIENT",AMHSORT,AMHSRT2)):^(AMHSRT2),1:0)
 S AMHNTOT=AMHNTOT+$S($D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"# SERVED",AMHSORT,AMHSRT2)):^(AMHSRT2),1:0)
 S AMHTTOT=AMHTTOT+$S($D(^XTMP("AMHRAP2",AMHJOB,AMHBTH,"TIME TOTAL",AMHSORT,AMHSRT2)):^(AMHSRT2),1:0)
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S AMHQUIT="" Q
HEAD1 ;
 W:$D(IOF) @IOF S AMHPG=AMHPG+1
 W !
 W ?58,AMHDT,?72,"Page ",AMHPG,!
 W ?17,"RECORD DATES:  ",AMHBDD,"  TO  ",AMHEDD,!
 S AMHLENG=30+$L(AMHTITL)
 W ?((80-AMHLENG)/2),"NUMBER OF ACTIVITY RECORDS BY ",AMHTITL,!
 W !,AMHHD1,?26,$E(AMHHD2,1,13),?42,"# RECS",?50,"# PATS",?60,"ACTIVITY",?70,"# SERVED",!,?60,"TIME",!
 W !,$TR($J(" ",80)," ","-")
 Q