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

AMHBHRP7.m

Go to the documentation of this file.
AMHBHRP7 ; IHS/CMI/LAB - behavioral health display for GUI ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
TEST ;
 D GARS2(.RETVAL,"01/01/2000","12/31/2005","A","A",,"S")
 Q
GARS2(AMHARRAY,AMHBD,AMHED,AMHPROG,AMHS,AMHPRV,AMHPSP) ;EP - AMHBH RPT GARS 2
 S JOB=$J,AMHGUI=1,XWBWRAP=1
 S ZTIO="",ZTQUEUED=1
 S AMHARRAY="^XTMP(""AMHRPT"","_$J_")"
 K ^XTMP("AMHRPT",$J)
 I $G(AMHBD)="" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed" D KILL Q
 D DT^DILF("X",AMHBD,.AMHBD)
 I $G(AMHBD)=-1 S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed" D KILL Q
 I $G(AMHED)="" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid ending date passed" D KILL Q
 D DT^DILF("X",AMHED,.AMHED)
 I $G(AMHED)=-1 S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid ending date passed" D KILL Q
 I $G(AMHPROG) S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid Program type passed" D KILL Q
 S AMHPROG=AMHPROG
 I "MSCOA"'[AMHPROG S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid Program type passed" D KILL Q
 I AMHPROG="A" S AMHPROG=""
 S AMHS=$G(AMHS)
 I AMHS'="O"&(AMHS'="A") S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid parameter - one or all providers" D KILL Q
 S AMHPRV=$G(AMHPRV)
 I AMHPRV,'$D(^VA(200,AMHPRV,0)) S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid provider IEN passed" D KILL Q
 I 'AMHPRV,AMHS="O" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Provider IEN not passed and type is O" D KILL Q
 I $G(AMHPSP)="" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Primary / Secondary parameter not passed" D KILL Q
 I "PS"'[AMHPSP S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid Primary/secondary parameter passed" D KILL Q
 S AMHPSP=AMHPSP
 K ^XTMP("AMHRPT",JOB)
 S ^XTMP("AMHRPTRUN",JOB)=""
 D ^XBKSET
 D ^AMHRP31
 ;S ZTRTN="TSK^AMHBHRP7",ZTIO="",ZTDESC="AMH ACTIVE CLIENT LIST",ZTSAVE("AMH*")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
 ;F I=1:1:120 Q:$G(^XTMP("AMHRPTRUN",$J))="DONE"  H 1
 D TSK
 D KILL
 Q
 ;
TSK ;
 D ^XBKSET
 S ^XTMP("AMHRPTRUN",JOB)="START"
 D GUIR^XBLM("^AMHRP3P","^XTMP(""AMHRPT"",JOB)")
 S ^XTMP("AMHRPT",JOB,.5)=$O(^XTMP("AMHRPT",JOB,""),-1)+1
 S ^XTMP("AMHRPTRUN",JOB)="DONE"
 Q
 ;
KILL ;
 D EN^XBVK("AMH")
 K DFN
 K AMHOA,AMHBT,AMHTOT
 K AMHCTR,AMHGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
 D XIT^AMHRP3
 Q