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

AMHRC5.m

Go to the documentation of this file.
AMHRC5 ; IHS/CMI/LAB - PERSONAL HX REPORT ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
START ;
 I '$D(IOF) D HOME^%ZIS
 W @(IOF),!!
 W "*******  LIST OF PATIENTS WITH PERSONAL HISTORY ITEMS  *******",!!
 D DBHUSRP^AMHUTIL
 ;
DEMO ;
 D DEMOCHK^AMHUTIL1(.AMHDEMO)
 I AMHDEMO=-1 G XIT
ZIS ;
 S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to ",DIR("B")="P" K DA D ^DIR K DIR
 I $D(DIRUT) G XIT
 I $G(Y)="B" D BROWSE,XIT Q
 S XBRC="PROC^AMHRC5",XBRP="PRINT^AMHRC5",XBNS="AMH",XBRX="XIT^AMHRC5"
 D ^XBDBQUE
XIT ;
 D EN^XBVK("AMH")
 Q
 ;
BROWSE ;
 S XBRP="VIEWR^XBLM(""PRINT^AMHRC5"")"
 S XBNS="AMH",XBRC="PROC^AMHRC5",XBRX="XIT^AMHRC5",XBIOP=0 D ^XBDBQUE
 Q
PROC ;EP - entry point for processing
 S AMHBT=$H K AMHDISP
 S AMHCASE=0
 F  S AMHCASE=$O(^AMHPPHX(AMHCASE)) Q:AMHCASE'=+AMHCASE  D PROC1
 S AMHET=$H
 K AMHCASE
 Q
PROC1 ;
 S AMHR=^AMHPPHX(AMHCASE,0)
 Q:'$$ALLOWP^AMHUTIL(DUZ,$P(AMHR,U,2))
 Q:$$DEMO^AMHUTIL1($P(AMHR,U,2),$G(AMHDEMO))
 Q:$P(AMHR,U,1)=""
 S X=$P(AMHR,U,1)
 Q:'$D(^AMHTPHF(X))
 S X=$P(^AMHTPHF(X,0),U)
 S:'$D(AMHDISP(X)) AMHDISP(X)="" S AMHDISP(X)=AMHDISP(X)+1,AMHDISP(X,$P(^DPT($P(AMHR,U,2),0),U),$P(AMHR,U,2))=""
 Q
PRINT ;EP - CALLED FROM XBDBQUE
 S AMH80D="-------------------------------------------------------------------------------"
 S AMHPG=0 D HEAD
 K AMHQ
 S AMHX="" F  S AMHX=$O(AMHDISP(AMHX)) Q:AMHX=""!($D(AMHQ))  D
 .I $Y>(IOSL-3) D HEAD Q:$D(AMHQ)
 .W !!,?17,AMHX
 .S AMHNAME="" F  S AMHNAME=$O(AMHDISP(AMHX,AMHNAME)) Q:AMHNAME=""!($D(AMHQ))  D
 ..S AMHP=0 F  S AMHP=$O(AMHDISP(AMHX,AMHNAME,AMHP)) Q:AMHP'=+AMHP!($D(AMHQ))  D
 ...I $Y>(IOSL-3) D HEAD
 ...W !?10,AMHNAME,?42,$$VAL^XBDIQ1(2,AMHP,.02),?52,$$AGE^AUPNPAT(AMHP,DT),?57,$$HRN^AUPNPAT(AMHP,DUZ(2))
 .W !,"SUBCOUNT: ",AMHDISP(AMHX)
 .Q
DONE ;
 D EOP^AMHRDE1
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S AMHQ="" Q
HEAD1 ;
 W:$D(IOF) @IOF S AMHPG=AMHPG+1
 W !,$P(^VA(200,DUZ,0),U,2),?(80-$L($P(^DIC(4,DUZ(2),0),U))/2),$P(^DIC(4,DUZ(2),0),U),!
 W "PERSONAL HISTORY LIST BY PATIENT",?44,$$FMTE^XLFDT($$NOW^XLFDT),?72,"Page ",AMHPG,!
 W ?10,"PATIENT",?42,"SEX",?52,"AGE",?57,"CHART NUMBER",!
 W AMH80D,!
 Q