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

AMHRP4.m

Go to the documentation of this file.
AMHRP4 ; IHS/CMI/LAB - ACTIVE CLIENT LIST ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
START ;
 I '$D(IOF) D HOME^%ZIS
 W @(IOF),!!
 W "**********  ACTIVE CLIENT LIST (USING CASE OPEN DATE)  **********",!!
 W "This report will produce a list of patients who have a case open date without a",!,"case closed date.",!
 I '$D(^AMHSITE(DUZ(2),16,DUZ)) D
 .W !,"This report will only include Cases on which you are the documented"
 .W !,"provider.",!!
 D DBHUSRP^AMHUTIL
 ;
PROG ;
 D XIT
 S AMHPROG=""
 S DIR(0)="S^O:ONE Program;A:ALL Programs",DIR("A")="Run the Report for which PROGRAM",DIR("B")="A" KILL DA D ^DIR KILL DIR
 G:$D(DIRUT) XIT
 I Y="A" G PROV
 S DIR(0)="9002011.58,.03",DIR("A")="Which PROGRAM" KILL DA D ^DIR KILL DIR
 G:$D(DIRUT) PROG
 I X="" G PROG
 S AMHPROG=Y
PROV ;
 S AMHPROV=""
 S DIR(0)="S^A:All Providers;O:One Provider",DIR("A")="Include cases opened by",DIR("B")="A" K DA D ^DIR K DIR
 G:$D(DIRUT) XIT
 I Y="A" G DEMO
 S DIC="^VA(200,",DIC(0)="AEMQ",DIC("A")="Which PROVIDER: " D ^DIC
 K DIC,DA
 I Y=-1 G PROV
 S AMHPROV=+Y
DEMO ;
 D DEMOCHK^AMHUTIL1(.AMHDEMO)
 I AMHDEMO=-1 G PROV
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^AMHRP4",XBRP="^AMHRP4P",XBNS="AMH",XBRX="XIT^AMHRP4"
 D ^XBDBQUE
XIT ;
 K ZTSK,Y,AMHBD,AMHED,IO("Q")
 D EN^XBVK("AMH")
 Q
 ;
BROWSE ;
 S XBRP="VIEWR^XBLM(""^AMHRP4P"")"
 S XBNS="AMH",XBRC="PROC^AMHRP4",XBRX="XIT^AMHRP4",XBIOP=0 D ^XBDBQUE
 Q
PROC ;EP - entry point for processing
 S AMHPCNT=0
 S AMHJOB=$J,AMHBTH=$H,AMHTOT=0,AMHCASE=0,AMHBT=$H,AMHCCNT=0
 D XTMP^AMHUTIL("AMHRP4","BH - ACTIVE CLIENT REPORT")
 F  S AMHCASE=$O(^AMHPCASE(AMHCASE)) Q:AMHCASE'=+AMHCASE  D PROC1
 S AMHET=$H
 K AMHCASE
 Q
PROC1 ;
 I '$$ALLOWCD^AMHLCD(DUZ,AMHCASE) Q
 Q:$P(^AMHPCASE(AMHCASE,0),U,5)]""  ;closed
 I AMHPROG]"",$P(^AMHPCASE(AMHCASE,0),U,3)'=AMHPROG Q
 I AMHPROV,$P(^AMHPCASE(AMHCASE,0),U,8)'=AMHPROV Q
 S DFN=$P(^AMHPCASE(AMHCASE,0),U,2)
 Q:'DFN
 Q:'$$ALLOWP^AMHUTIL(DUZ,DFN)
 Q:$$DEMO^AMHUTIL1(DFN,$G(AMHDEMO))
 I '$D(^XTMP("AMHRP4",AMHJOB,AMHBTH,"PATIENTS",DFN)) S AMHPCNT=AMHPCNT+1,^XTMP("AMHRP4",AMHJOB,AMHBTH,"PATIENTS",DFN)=""
 S ^XTMP("AMHRP4",AMHJOB,AMHBTH,"CASES",$P(^DPT(DFN,0),U),DFN,AMHCASE)=AMHCASE,AMHCCNT=AMHCCNT+1
 Q
 ;